OnixS C++ ICE Binary Order Entry Handler 1.1.2
API Documentation
Loading...
Searching...
No Matches

Method Signature

OnixS::ICE::BOE::Scheduling::SessionScheduler provides these overloads for BGW sessions:

SessionScheduler& add(BgwSession* session, const SessionSchedule& schedule, IBgwCredentialsProvider* bgwCredentialsProvider); SessionScheduler& add(BgwSession* session, const SessionScheduleId& scheduleId, IBgwCredentialsProvider* bgwCredentialsProvider);

Parameters

  • session is the BGW session to be managed by the Scheduler.
  • schedule defines active/inactive time frames for automatic connect/disconnect.
  • scheduleId identifies a predefined schedule from Scheduler configuration.
  • bgwCredentialsProvider supplies BGW credentials on the first connection attempt.

Behavior

  • If the session is added during an active time frame, Scheduler connects it immediately.
  • If the session is added during an inactive time frame and it is currently active, Scheduler disconnects it.
  • If the session was already registered, an exception is thrown.
  • For the scheduleId overload, an exception is thrown if the schedule id is not found.

Example

The example below shows how to register a BGW session with a custom schedule. In this example, BusSession is used as IBgwCredentialsProvider.

SessionSchedule scheduleForBus(
TimeOfDay(9, 0),
TimeOfDay(18, 0));
scheduler.add(&bgwSession, scheduleForBus, &busSession);
SessionSchedule scheduleForBgw(
TimeOfDay(9, 2), //give BGW session 2 minutes to start after the BUS session is started
TimeOfDay(18, 0));
// BUS session implements IBgwCredentialsProvider and can be passed directly.
scheduler.add(&bgwSession, scheduleForBgw, &busSession);

See Also