Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjosolutions/luastoppable
A library for working with stoppables.
https://github.com/sanjosolutions/luastoppable
wow wow-addon wow-addon-lib
Last synced: 5 days ago
JSON representation
A library for working with stoppables.
- Host: GitHub
- URL: https://github.com/sanjosolutions/luastoppable
- Owner: SanjoSolutions
- License: unlicense
- Created: 2022-12-22T22:06:16.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T17:16:50.000Z (about 1 year ago)
- Last Synced: 2024-05-01T19:25:54.927Z (8 months ago)
- Topics: wow, wow-addon, wow-addon-lib
- Language: Lua
- Homepage: https://www.patreon.com/addons_by_sanjo
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stoppable
A library for working with stoppables. Stoppables are similar to promises or futures. In addition, they can be stopped.
This library can save add-on developers some work.## Things included
* **Stoppable.Stoppable**: the class for the stoppable construct.
* **Stoppable.Stoppable.new**: the constructor for the Stoppable class.
* **Stoppable.all**: returns a new stoppable that when stopped also stops all given stoppables.**Methods:**
* **hasBeenRequestedToStop**: returns if the stoppable has been requested to stop.
* **isRunning**: returns if the stoppable is running.
* **hasStopped**: returns if the stoppable has stopped.
* **stop**: requests that the stoppable stops.
* **alsoStop**: registers another stoppable to also stop.
* **onStop**: registers a callback that is run after "stop" has been called.
* **afterStop**: registers a callback that is run after the stoppable has stopped.**Private methods (are returned as the second return value of the constructor):**
* **resolve**: resolves the stoppable with the given values and marks it as stopped.