On 02/01/2012 11:21 AM, Andrew Stitcher wrote:
On Wed, 2012-02-01 at 10:21 -0500, Alan Conway wrote:
Presently the C++ client takes options for reconnecting (reconnect-timeout,
reconnect-interval-min/max etc.) in seconds. A second is too long for
applications that require rapid fail-over. I'd like to make these values more
fine grained, but I don't want to break the existing interface.

Proposal: Have C++ treat reconnect time values as floats, so e.g.
reconnect-interval-min=0.001 sets a millisecond as the minimum interval.
Existing code will be unaffected. I believe this is already the case for the
python client, since python normally expresses time in floating-point seconds.

Does anyone see a problem with this approach or have an alternative suggestion?
The only alternatives I can think of are:

- break backward compatibility and re-interpret reconnect values as milliseconds
or nanoseconds rather than seconds.
- add another set of reconnect-timeout-ms or reconnect-timeout-ns options on top
of the existing second options.

How about interpreting the value as a string and allowing suffixes to
modify the time value:

so

--reconnect-timeout 1 == 1s [existing]
--reconnect-timeout 1s == the same as above but explicit
--reconnect-timeout 20ms == new mode less than a second
--reconnect-timeout 100us == 100 microsecs
--reconnect-timeout 1000ns == 1 microsecond (probably uselessly short)

I feel like the float approach is simpler. There's already a convenient and _standard_ notation for expressing small values e.g. 1e-6 is a microsecond, 100e-6 is 100 microseconds, 1e-9 is a nanosecond etc. No need to introduce a parser for a new notation.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to