Giter VIP home page Giter VIP logo

seneca-queue's People

Contributors

adrieankhisbe avatar code-jace avatar geek avatar lucalanziani avatar mcdonnelldean avatar mcollina avatar mihaidma avatar paolochiodi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seneca-queue's Issues

use fastq or steed

It should use fastq or steed, which are much faster than async.queue. The API is the same, so it should be an easy fix.

client crashes if server is down

i used your examples, only started 1 server, put the client in an interval loop.
kept getting errors for the server that wasn't up.
i see a blacklist in your code, but maybe it's not used for this purpose. if it is then it's failing.

after a minute or so my client crashes.

maybe the queue should kick clients out that error.

Trello Card

"Automagic" queues discovery: behaviour and problems

At the moment external queue implementation are discovered automatically by searching for registered actions with the appropriate "hook" pattern. Requests are then distributed among found implementations with a round robin algorithm.

I think this may cause two problems:

  • seneca queue can't pass options to the external implementations leaving the burden to to so to the final users, which is counter intuitive (especially when changing "role")
  • this makes difficult to have different implementations at the same time - because seneca-queue split the requests among all the different implementations. It could be useful to allow the split to be based on the task type

We may also want to create a seneca-queue-test package to check for queues conformity (along the lines of seneca-store-test and seneca-transport-test)

How to return value in callback

how to return error/success value callback from server??
I have return with certain parameters but it get undefined
Ex-
Client.js
var s = require('seneca')()
.client({ port: 8081, pin: 'cmd:enqueue-remote,queue:q1' })
.use('../', {
queues: ['q1', 'q2']
})
var res_cb=function(err,success){
console.log("Success",success);
}
s.act({ role: 'queue', cmd: 'enqueue', msg: { task: 'my task', param: 1 ,count:1}},res_cb);

Server1.js
var s = require('seneca')()
.use(require('../'))
.listen({ port: 8081 })

s.add({
task: 'my task'
}, function(args, cb) {
return cb(null, { b: 2 })
})

console.log('worked if you see OK two times')
s.act({ role: 'queue', cmd: 'start' })

Output of client.js
Success undefined

The returned value gets undefined. can you please suggest any way to achieive these.

Thanks,
Jayesh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.