diff --git a/lib/memory.js b/lib/memory.js index 74f527e..690710c 100644 --- a/lib/memory.js +++ b/lib/memory.js @@ -4,7 +4,7 @@ var Async = require('async') module.exports = function memory (role, seneca, options) { function worker (task, done) { - seneca.act(task, done) + seneca.root.delegate({role$: role}).act(task, done) } var queue = Async.queue(worker, options.concurrency) diff --git a/test/roles.test.js b/test/roles.test.js index 9f974d8..90735a1 100644 --- a/test/roles.test.js +++ b/test/roles.test.js @@ -135,7 +135,7 @@ describe('seneca queue', function () { task: 'my task' }, function (args, cb) { expect(args).to.include(task) - expect(args.plugin$).to.include({ tag: secondTime ? 'queue2' : 'queue1' }) + expect(args.role$).to.equal(secondTime ? 'role2' : 'role1') cb() if (secondTime) {