https://github.com/okturtles/okturtles.eventqueue
Synchronize asynchronous SBP invocations
https://github.com/okturtles/okturtles.eventqueue
Last synced: 11 months ago
JSON representation
Synchronize asynchronous SBP invocations
- Host: GitHub
- URL: https://github.com/okturtles/okturtles.eventqueue
- Owner: okTurtles
- License: mit
- Created: 2022-02-03T05:04:05.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-10T20:41:47.000Z (over 1 year ago)
- Last Synced: 2025-07-14T02:44:47.995Z (11 months ago)
- Language: TypeScript
- Homepage:
- Size: 166 KB
- Stars: 1
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# `okTurtles.eventQueue`
A serial event queue for asynchronous [SBP](https://github.com/okTurtles/sbp-js) invocations.
Use this to ensure asynchronous SBP invocations get invoked serially, one after another, waiting for the previous invocation to finish completely.
Install:
```
$ npm install --save @sbp/okturtles.eventqueue
```
Usage:
```js
import sbp from '@sbp/sbp'
import '@sbp/okturtles.eventQueue'
async function syncronousHandleEvent (event) {
// here the SBP invocation to 'state/vuex/dispatch' will be
// passed to an event queue designated by 'queue1'
const result = await sbp('okTurtles.eventQueue/queueEvent', 'queue1', [
'state/vuex/dispatch', 'handleEvent', event
])
return result
}
```
Registers the following selectors:
- `'okTurtles.eventQueue/queueEvent'`
- `'okTurtles.eventQueue/isWaiting'`
- `'okTurtles.eventQueue/queuedInvocations'`
## History
See [HISTORY.md](HISTORY.md).
## License
[MIT](LICENSE.txt).