@mishguru/turbine-driver-local
TypeScript icon, indicating that this package has built-in type declarations

6.35.0 • Public • Published

@mishguru/turbine-driver-local

A single service in-memory driver

import createService from '@mishguru/turbine'
import createDriver from '@mishguru/turbine-driver-local'

const service = createService({
  serviceName: 'my-service',
  driver: createDriver()
})

service.handle('greet', async (message) => {
  const { payload } = message
  const { name, text } = payload
  console.log(`Received greeting "${text}" from ${name}`)
})

void async function main () {
  await service.start()

  await service.dispatch({
    type: 'greet',
    payload: {
      name: 'george',
      text: 'hi there!'
    }
  })

  // prints: Received greeting "hi there!" from george
}()

/@mishguru/turbine-driver-local/

    Package Sidebar

    Install

    npm i @mishguru/turbine-driver-local

    Weekly Downloads

    1

    Version

    6.35.0

    License

    MIT

    Unpacked Size

    78.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • alexp643
    • mishbuild
    • jladuval
    • ashokfernandez
    • stayradiated
    • kmmontzka