3.4.0 • Published 5 years ago
@stayradiated/turbine-driver-google-cloud-pubsub v3.4.0
turbine
A minimal library for event based microservices
import createService from '@stayradiated/turbine'
import createAmqpDriver from '@stayradiated/turbine-driver-amqplib'
const service = createService({
serviceName: 'scheduler',
driver: createAmqpDriver({url: 'amqp://localhost'})
})
service.handle('schedule', (message, dispatch) => {
const { payload } = message
const { scheduledAt, messageToDispatch } = payload
const delay = Date.now() - scheduledAt
setTimeout(() => {
dispatch({
type: messageToDispatch.type,
payload: messageToDispatch.payload
})
}, delay)
})
service.start()
.then(() => console.log('Service has started'))
.catch(console.error)
Installation
You will need the core turbine service.
npm install --save @stayradiated/turbine
As well as a driver to use.
@stayradiated/turbine-driver-amqplib
@stayradiated/turbine-driver-aws-fanout
@stayradiated/turbine-driver-mock
Development
git clone https://github.com/stayradiated/turbine
npm install
npm run bootstrap
npm run build
Publishing
When publishing changes, you should not use npm publish
manually.
Instead use:
npm run deploy
3.4.0
5 years ago
3.3.0
5 years ago
3.2.0
5 years ago
3.1.0
5 years ago
3.0.0
5 years ago
2.2.0
5 years ago
2.1.0
5 years ago
2.0.0
5 years ago
1.14.0
6 years ago
1.13.0
6 years ago
1.12.0
6 years ago
1.11.0
6 years ago
1.10.0
6 years ago
1.9.0
6 years ago
1.8.0
6 years ago
1.7.0
6 years ago
1.6.0
6 years ago
1.5.0
6 years ago
1.4.0
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago