talk = require 'talk-node-sdk'
config =
appToken: 'yyyyyy-ffff-gggg-hhhh-aaaaaaaaaaa'
apiHost: 'http://localhost:7001'
talk.init(config)
# Initialize a webhook reciever service
app = require('express')()
service = talk.service app, prefix: '/'
# Initialize a worker
worker = talk.worker
interval: 100
runner: (task) -> # Call the runner when the task executed
# OR
# Use the cron pattern to define the interval of ticks
worker = talk.worker
cron: '* * * * * *'
runner: (task)->
## An 'execute' event will be emitted when a task executed
worker.on 'execute', (task) ->
## Bind the worker to the service
worker.watch service
# Initialize another client
client = talk.client(token)
- Use cron to execute worker
*
listen to all eventmessage.create
message create event
- Use the cron pattern to define interval of ticks
- execute jobs parallelly, set the default concurrency to 5
- add worker in sdk
- use promise
- remove
express
dependency
- move event emitter to service
- reconnect the api server when the discover api failed
- bump to new version
- Use methods from
discover
api - Add support for 'GET', 'PUT', 'POST', 'DELETE' methods
- Replace url params with the correct value