-
Notifications
You must be signed in to change notification settings - Fork 10
Misc
juxeii edited this page Oct 21, 2016
·
2 revisions
This page shows some classes which you might useful.
Class: StrategyThreadRunner
/ Package: com.jforex.programming.misc
The Dukascopy Wiki
explains that some critical operations need to be run on the strategy thread. In order to avoid all this verbose threading stuff you can use the class StrategyThreadRunner
which can be obtained from JForexUtil
. The runner class lets you choose between actions
and callables
to run, here are two examples:
StrategyThreadRunner runner = jForexUtil.strategyThreadRunner();
runner.execute(() -> System.out.println("Hello from Action"));
runner.execute(() -> {
System.out.println("Hello from Callable");
return 1;
});
The execute
overload for the action
returns a Completable
, while the callable
overload returns a Single
. Check out the javadocs for the exact signatures.