Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Adding a simple usage example for demissions, mainly proving they work
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Williams committed Jan 9, 2017
1 parent 0becae8 commit 22e43e9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/basicDemission/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const remit = require('../../')({
name: 'examplesBasicDemission'
})

remit.listen('examples.basic.demission')
.data((event, callback) => {
console.log('Got event', event)

return callback(null, true)
})
.ready().then(() => {
Array.from([5000, 7000, 1000, 3000, 4000, 9000, 2000, 10000, 6000, 8000]).forEach((time) => {
remit.demit('examples.basic.demission')({foo: 'bar'}, (new Date(+new Date() + time)))
})
})

0 comments on commit 22e43e9

Please sign in to comment.