Closed GoogleCodeExporter closed 8 years ago
Indeed. The message was sent to redis, regardless of what you do back in the
client. There is no "actually, cancel that" in redis, so at the server-end the
connection is going to block on either the timeout or a value to return. When a
response comes back, it is still the response to that original request, no
matter what you've done in the interim (in most cases, the next command is
going to be something with a completely different result pattern) - so it can't
say "oh, never mind - I'll give that reply to the next task" - that makes no
sense.
As for BookSleeve raising an error: it simply doesn't have that option
available. The task API is the task API. It can't change how it works. If you
do something that isn't sensible, then bad things will happen.
Ultimately, the fundamental issue here is that what you want simply can't be
supported on a redis connection. You could poll with a short timeout repeatedly
- for example 1 second. But frankly I usually advise *against* using the
blocking calls - they are antithetical to a multiplexer. My preferred pattern
here would be to subscribe to a "here be data" channel, with a callback that
uses a non-blocking fetch. Then publish a message to that channel when you
insert data.
Original comment by marc.gravell
on 3 Apr 2013 at 7:10
Original comment by marc.gravell
on 20 Mar 2014 at 12:10
Original issue reported on code.google.com by
phpla...@gmail.com
on 3 Apr 2013 at 12:28