On Mon, Feb 27, 2012 at 5:26 AM, Kaspar Schiess <[email protected]> wrote:
>        1) Only to be able to specify 1 second min. is really too long a
> delay. I would like to be able to specify at least tenths of a second, if
> not a finer granularity.

That's a reasonable request. Could you file an issue?

>        2) If I select on beanstalk-connected sockets and normal tcp sockets
> simultaneously, one of the normal sockets might be ready before the timeout
> of reserve-with-timeout expires. The beanstalk connection then stays locked
> until that timeout passes.

That's how sockets are supposed to work. The select call will tell
you which fds are ready. If the beanstalkd connection isn't ready,
don't read from it.

> Implementation: I would probably explore along the lines of an 'abort'
> command, that aborts a reserve-with-timeout prematurely. Not sure if this
> matches the way beanstalkd is implemented, but I guess I would find out
> quickly.

This is more interesting, and hints at the real problem I suspect
you're asking about:

If the client is currently waiting for a reserve response and has
other commands it wants to send, it can't send them immediately. It
either has to wait or open another connection.

This has come up several times before, and I agree it's a problem.
Let's see what it would take to fix.

It would actually be quite easy to have beanstalkd abort a waiting
reserve command when *any* other command appears on the connection,
but I'm afraid that behavior might be confusing. Also, there's no
good way to indicate this case in the response of the existing
reserve command. (This is a design flaw in the v1.0 beanstalkd
protocol. It should have allowed for the possibility of introducing
new error codes in the future.) We could work around both of these
problems by making a new command that's like reserve, but can be
aborted.

Would that serve your needs?

kr

-- 
You received this message because you are subscribed to the Google Groups 
"beanstalk-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/beanstalk-talk?hl=en.

Reply via email to