[rabbitmq-discuss] Using rabbitmq-http2 (was: simple.publish over the JSON RPC interface)

Tony Garnock-Jones tonyg at lshift.net
Wed Aug 12 05:04:21 BST 2009


Nathan Gray wrote:
> It seems to me that there's no one-size-fits-all timeout for poll.
> Some apps will want non-blocking polling and others will want it to
> block indefinitely until there's work to do.  Wouldn't it be better to
> just have an explicit timeout parameter to poll()?

Yes, but that makes the timeout-maintaining code in the channel object
much more complex. Generally, channel *instances* are not shared between
applications, so each app is still free to set sessionTimeout according
to its needs. One app could set it to half an hour (and get
corresponding 15-minute poll() cycles), another to 30s. The current
setup lets all parallel poll()s on a single instance (if there's more
than one) be treated identically; a timeout parameter to each poll()
would require a separate timer on the server-side for each. Ultimately
though, if the way it's currently being done is shown to be a problem,
it's totally changeable.

Adding a *non*-blocking variant of poll() is an interesting idea. I
hadn't thought anyone would want that! Is it something you would use?

Tony




More information about the rabbitmq-discuss mailing list