qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject Re: C++ messaging client: fractional values for reconnect parameters?
Date Wed, 01 Feb 2012 16:21:29 GMT
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)

etc.

Andrew




---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message