@sbp/okturtles.eventqueue
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

okTurtles.eventQueue

A serial event queue for asynchronous SBP 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:

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.

License

MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i @sbp/okturtles.eventqueue

Weekly Downloads

13

Version

1.2.0

License

MIT

Unpacked Size

21.4 kB

Total Files

14

Last publish

Collaborators

  • taoeffect