It sounds like you are asking for a name that can be derived from the
job in some way, so it doesn't need to be stored. That's an
interesting property, but I don't know how widely useful it would be.
You could try to design the worker to recognize situations where the
job doesn't need to run. Then you wouldn't need to delete the job. You
could just schedule a second job if necessary.
Other possible beanstalk features that would help here are a search
function and content-addressability. But again, I don't know if they
would be a good idea in the broader context of beanstalk use.
Do others have opinions here?
> Is it possible to query beanstalk by jobid and change parameters on an
> existing job? (perhaps I'm using out of date ruby client?)
You can do queue.peek_job(id) and then manipulate the resulting job,
but the available operations are very limited. I'm interested in
removing some of those limitations; what operations are you interested
in? From your description it sounds like you want at least to delete
or change the delay time.
kr
That's almost what I meant by content-addressability, except that the
hash would be server-generated. Then the client wouldn't have to worry
about picking a unique name.
Upon further reflection, though, I think it's better if the client
picks the name. Those clients that don't care about the name can just
ignore this feature; those that do care will probably have little
difficulty selecting a naming scheme. Also, a server-generated hash
for every job would make life difficult if the clients want to submit
several jobs with the same body.
I'll put this on my list, but it'll be a while before I can get to it.
If anyone else is interested in implementing it, I'd be happy to
accept a patch. My current protocol design plan is to add a single
command:
put-named <name> <pri> <delay> <ttr> <bytes>\r\n
<data>\r\n
which is the same as the usual put command, but also gives the job a
name. If the name is taken, this would respond:
NAME_TAKEN_BY <id>\r\n
where <id> is the already-existing job's id.
If a job has been given a name, the name can be used in place of its
id to refer to the job anywhere in the protocol.
Also, the job name (if any) should be added to the job stats response.
kr