mirror of
https://github.com/openstf/stf
synced 2025-10-05 10:39:25 +02:00
Separate device functionality into plugins.
This commit is contained in:
parent
d61a70fda5
commit
3d20b06f7f
24 changed files with 1277 additions and 700 deletions
15
lib/roles/device/plugins/router.js
Normal file
15
lib/roles/device/plugins/router.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
var syrup = require('syrup')
|
||||
|
||||
var wirerouter = require('../../../wire/router')
|
||||
|
||||
module.exports = syrup()
|
||||
.dependency(require('./sub'))
|
||||
.dependency(require('./channels'))
|
||||
.define(function(options, sub, channels) {
|
||||
var router = wirerouter()
|
||||
sub.on('message', router.handler())
|
||||
router.on('message', function(channel) {
|
||||
channels.keepalive(channel)
|
||||
})
|
||||
return router
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue