Lean  $LEAN_TAG$
QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer Class Reference

Provides the ability to synchronize subscriptions into time slices More...

Inheritance diagram for QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer:
[legend]

Public Member Functions

 SubscriptionSynchronizer (UniverseSelection universeSelection)
 Initializes a new instance of the SubscriptionSynchronizer class More...
 
void SetTimeProvider (ITimeProvider timeProvider)
 Sets the time provider. If already set will throw. More...
 
void SetTimeSliceFactory (TimeSliceFactory timeSliceFactory)
 Sets the TimeSliceFactory instance to use More...
 
IEnumerable< TimeSliceSync (IEnumerable< Subscription > subscriptions, CancellationToken cancellationToken)
 Syncs the specified subscriptions. The frontier time used for synchronization is managed internally and dependent upon previous synchronization operations. More...
 
DateTime GetUtcNow ()
 Returns the current UTC frontier time More...
 

Protected Member Functions

virtual void OnSubscriptionFinished (Subscription subscription)
 Event invocator for the SubscriptionFinished event More...
 

Events

EventHandler< SubscriptionSubscriptionFinished
 Event fired when a Subscription is finished More...
 
- Events inherited from QuantConnect.Lean.Engine.DataFeeds.ISubscriptionSynchronizer
EventHandler< SubscriptionSubscriptionFinished
 Event fired when a subscription is finished More...
 

Detailed Description

Provides the ability to synchronize subscriptions into time slices

Definition at line 29 of file SubscriptionSynchronizer.cs.

Constructor & Destructor Documentation

◆ SubscriptionSynchronizer()

QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.SubscriptionSynchronizer ( UniverseSelection  universeSelection)

Initializes a new instance of the SubscriptionSynchronizer class

Parameters
universeSelectionThe universe selection instance used to handle universe selection subscription output
Returns
A time slice for the specified frontier time

Definition at line 47 of file SubscriptionSynchronizer.cs.

Member Function Documentation

◆ SetTimeProvider()

void QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.SetTimeProvider ( ITimeProvider  timeProvider)

Sets the time provider. If already set will throw.

Parameters
timeProviderThe time provider, used to obtain the current frontier UTC value

Definition at line 56 of file SubscriptionSynchronizer.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetTimeSliceFactory()

void QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.SetTimeSliceFactory ( TimeSliceFactory  timeSliceFactory)

Sets the TimeSliceFactory instance to use

Parameters
timeSliceFactoryUsed to create the new TimeSlice

Definition at line 70 of file SubscriptionSynchronizer.cs.

Here is the caller graph for this function:

◆ Sync()

IEnumerable<TimeSlice> QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.Sync ( IEnumerable< Subscription subscriptions,
CancellationToken  cancellationToken 
)

Syncs the specified subscriptions. The frontier time used for synchronization is managed internally and dependent upon previous synchronization operations.

Parameters
subscriptionsThe subscriptions to sync
cancellationTokenThe cancellation token to stop enumeration

Implements QuantConnect.Lean.Engine.DataFeeds.ISubscriptionSynchronizer.

Definition at line 85 of file SubscriptionSynchronizer.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnSubscriptionFinished()

virtual void QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.OnSubscriptionFinished ( Subscription  subscription)
protectedvirtual

Event invocator for the SubscriptionFinished event

Definition at line 259 of file SubscriptionSynchronizer.cs.

Here is the caller graph for this function:

◆ GetUtcNow()

DateTime QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.GetUtcNow ( )

Returns the current UTC frontier time

Implements QuantConnect.ITimeProvider.

Definition at line 267 of file SubscriptionSynchronizer.cs.

Here is the call graph for this function:

Event Documentation

◆ SubscriptionFinished

EventHandler<Subscription> QuantConnect.Lean.Engine.DataFeeds.SubscriptionSynchronizer.SubscriptionFinished

Event fired when a Subscription is finished

Definition at line 39 of file SubscriptionSynchronizer.cs.


The documentation for this class was generated from the following file: