On 10/12/07, Erik Vullings <[EMAIL PROTECTED]> wrote:
[...]
> I have two RESTlets, one acting as a sensor, the other as a detector. The
> sensor serves data that is consumed by the detector. Since the sensor
> RESTlet continuously generates data, I want to stream this data to the
> detector(s) RESTlet. What's the best way to do this?

First off, Rob made a number of good points that should be consider so
I'll approach this from a completely different angle for a different
perspective... :-)

You might find it much easier to turn your relationship around...
I.e., rather than having the sensor try to stream the data to the
detector over long periods, just have the sensor send "events" to the
detector.  Depending on the period, data volume, etc. you can have the
sensor bundle them into groups and send entire bundles per round.

If you configure your client and server to both allow pipelining then
the setup and teardown costs of the underlying channel is amortized
over a number of individual rounds.

> And what kind of
> representation should the sensor generate if we are dealing with simple data
> ( e.g. numbers). If I get a good solution, I promise to put it on the new
> Wiki.

Do you need any structured information about the data elements or is
it a uniform stream of numbers that are all the same?  Is there
optional information or is it always uniform?  If it's always uniform
then I'd do the old Unix stream game and just return the numbers 1 per
line or one set per line.  If ordering across bundles matter then add
a full timestamp and a sensor specific full ID and perhaps a nonce as
the first two lines of each bundle.

Hope this helps,
John

Reply via email to