Class LiveScoutDisruptorDispatcher
java.lang.Object
com.sportradar.livedata.sdk.dispatch.DisruptorDispatcher<LiveScoutDispatcherContainer>
com.sportradar.livedata.sdk.dispatch.livescout.LiveScoutDisruptorDispatcher
- All Implemented Interfaces:
- LiveFeedDispatcher<LiveScoutFeed>,- LiveScoutDispatcher
public class LiveScoutDisruptorDispatcher
extends DisruptorDispatcher<LiveScoutDispatcherContainer>
implements LiveScoutDispatcher
A 
LiveScoutDispatcher implementation which uses disruptor to dispatch messages on multiple threads- 
Field SummaryFields inherited from class com.sportradar.livedata.sdk.dispatch.DisruptorDispatcherdispatcherCount, dispatcherQueueSize, halfDispatcherQueueSize, sdkLogger
- 
Constructor SummaryConstructorsConstructorDescriptionLiveScoutDisruptorDispatcher(int dispatcherCount, int dispatcherQueueSize, ExecutorService executor, LiveScoutStatisticsCounter counter) Initializes a new instance of theLiveScoutDisruptorDispatcherclass.
- 
Method SummaryModifier and TypeMethodDescriptionprotected com.lmax.disruptor.EventHandler<LiveScoutDispatcherContainer>[]Constructs and returns an array ofEventHandlerinstances representing disruptor dispatchers.voiddispatchEntity(LiveScoutEntityBase entity) Dispatches the passedLiveScoutEntityBaseto the uservoiddispatchOnClosed(LiveScoutFeed sender) voiddispatchOnFeedEvent(LiveScoutFeed sender, FeedEventType eventType) voiddispatchOnInitialized(LiveScoutFeed sender) voiddispatchOnOpened(LiveScoutFeed sender) voidsetFeed(LiveScoutFeed feed) Set the feed.voidstart(LiveScoutFeedListener listener) Starts the currentLiveScoutDispatchervoidstop()Stops the currentLiveScoutDispatcherand disposed any resources associated with it.Methods inherited from class com.sportradar.livedata.sdk.dispatch.DisruptorDispatcherpublish, startDisruptor, stopDisruptor
- 
Constructor Details- 
LiveScoutDisruptorDispatcherpublic LiveScoutDisruptorDispatcher(int dispatcherCount, int dispatcherQueueSize, ExecutorService executor, LiveScoutStatisticsCounter counter) Initializes a new instance of theLiveScoutDisruptorDispatcherclass.- Parameters:
- dispatcherCount- The number of the consumers which dispatch events to the user.
- dispatcherQueueSize- The size of the disruptor.
- executor- The- ExecutorServiceused to spawn background threads
- counter- The- LiveScoutStatisticsCounterevent counter used as JMX MBeans
 
 
- 
- 
Method Details- 
dispatchOnClosed- Specified by:
- dispatchOnClosedin interface- LiveFeedDispatcher<LiveScoutFeed>
 
- 
dispatchOnFeedEvent- Specified by:
- dispatchOnFeedEventin interface- LiveFeedDispatcher<LiveScoutFeed>
 
- 
dispatchOnInitialized- Specified by:
- dispatchOnInitializedin interface- LiveFeedDispatcher<LiveScoutFeed>
 
- 
dispatchOnOpened- Specified by:
- dispatchOnOpenedin interface- LiveFeedDispatcher<LiveScoutFeed>
 
- 
startStarts the currentLiveScoutDispatcher- Specified by:
- startin interface- LiveScoutDispatcher
- Parameters:
- listener- The- LiveScoutFeedListenerused by the current- LiveScoutFeedListenerto dispatch events
 
- 
stoppublic void stop()Stops the currentLiveScoutDispatcherand disposed any resources associated with it.- Specified by:
- stopin interface- LiveScoutDispatcher
 
- 
dispatchEntitypublic void dispatchEntity(LiveScoutEntityBase entity) throws com.lmax.disruptor.InsufficientCapacityException Dispatches the passedLiveScoutEntityBaseto the user- Specified by:
- dispatchEntityin interface- LiveScoutDispatcher
- Parameters:
- entity- the- LiveScoutEntityBaseto dispatch to the user.
- Throws:
- com.lmax.disruptor.InsufficientCapacityException- ring buffer is full.
 
- 
setFeedSet the feed.- Specified by:
- setFeedin interface- LiveScoutDispatcher
- Parameters:
- feed- feed that will be served.
 
- 
buildConsumersConstructs and returns an array ofEventHandlerinstances representing disruptor dispatchers.- Specified by:
- buildConsumersin class- DisruptorDispatcher<LiveScoutDispatcherContainer>
- Returns:
- an array of EventHandlerinstances representing disruptor dispatchers.
 
 
-