Giter Club home page Giter Club logo

Comments (5)

chrcao avatar chrcao commented on June 10, 2024

hi, why consumer need to be isolated from producers?
beanstalkd not support that scenario or other reasons?

from turbocharged.beanstalk.

jennings avatar jennings commented on June 10, 2024

Hi @chrcao!

Beanstalk does support that scenario, but you have to be careful with it.

It has been a while since I worked with Beanstalk, but as I recall, Beanstalk responds to commands in the order they were sent. Let's say a client tried to be a consumer and producer at the same time, and sent these commands:

reserve
put 1 0 10 foobar

If there are no jobs in the tube for the reserve, then the put will be ignored until the reserve finally receives a job.

That's probably not a great outcome, and it would be easy to make that mistake. So, that's why I feel like a good client library should help the developer avoid accidentally causing that problem.

from turbocharged.beanstalk.

chrcao avatar chrcao commented on June 10, 2024

@jennings thanks for you answer, i got the point.
and another question when I review beanstalkd code. the data type of job id from beanstalkd is uint64.
in c#, the same capacity data type is ulong. Wil these cause problem when beanstalkd insert new job and return a job id more bigger than int(using in this client)?

from turbocharged.beanstalk.

jennings avatar jennings commented on June 10, 2024

Probably! 😄

Good catch. If you want to create a pull request for that, please do.

from turbocharged.beanstalk.

jennings avatar jennings commented on June 10, 2024

I no longer think this issue makes sense to do. The caller is perfectly capable of managing the number of connections they create.

But it does make sense to make BeanstalkConnection handle reconnection logic. Right now, if you create a worker and the connection dies, the worker dies. That isn't good.

from turbocharged.beanstalk.

Related Issues (7)

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.