Order Operations Thread Safe dispatch ?
Order Operations Thread Safe dispatch ?
07 Apr 2015, 22:37
For a Robot which has its own asynchronous Threading,
what is the method of safely dispatching Orders and Trade Requests?
For example, in JForex Java API the Callable interface is used so that
any asynchronous thread can safely dispatch Order Entry operations
using Future<type> f = context.executeTask(<task implementing Callable interface>)
Thanks!
HyperScalper
Replies
hyperscalper
09 Apr 2015, 03:18
Well, the "poor man's way" of doing things would be to
queue up some action specs, and maybe pick items off the
queue for execution on a Timer tick maybe..... But I was
hoping for a more advanced method. HyperScalper
@hyperscalper
Spotware
09 Apr 2015, 17:19
Dear Trader,
Currently there is no such dispatching method in the API. We plan to add it in the future.
Well, the "poor man's way" of doing things would be to
queue up some action specs, and maybe pick items off the
queue for execution on a Timer tick
It is the only way for now.
@Spotware
hyperscalper
07 Apr 2015, 22:42
Trying to be clear here, what I mean is that normally Robot trading
logic is placed in onTick or onBar. For critical trade operations, from asynchronous
threads there needs to be a way for those asynchronous threads to safely
execute/dispatch code, as though the code were in the onTick or onBar context
and executing on the same thread, I assume, which is used to serialize operations.
HyperScalper
@hyperscalper