Beamable SDK
Public Member Functions | List of all members
Beamable.Player.SdkEventService Class Reference
Inheritance diagram for Beamable.Player.SdkEventService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Player.SdkEventService:
Collaboration graph
[legend]

Public Member Functions

 SdkEventService (IConnectivityService connectivityService)
 
Promise Add (SdkEvent evt)
 Add a SdkEvent to the event pipeline. Any SdkEventConsumers that were created with the Register method, that match the evt's SdkEvent.Source property will be triggered. If there are no events being processed when this method is called, the event will be processed immediately. If there are already events being processed, or if this method is called as a side effect of an earlier call to Add, then the event will be enqueued and processed after all existing events have been processed. More...
 
void Process ()
 This will be removed in a future version of Beamable, please do not use. The processing happens immediately when events are added via the Add method. There should never be a need to manually process the events. More...
 
SdkEventConsumer Register (string source, SdkEventHandler handler)
 Register a handler function that will trigger anytime an SdkEvent is processed that matches the given source argument. More...
 
void Unregister (SdkEventConsumer consumer)
 Unregister a SdkEventConsumer so that the SdkEventHandler will not trigger for SdkEvent's of the given SdkEventConsumer.Source. More...
 

Member Function Documentation

◆ Add()

Promise Beamable.Player.SdkEventService.Add ( SdkEvent  evt)
inline

Add a SdkEvent to the event pipeline. Any SdkEventConsumers that were created with the Register method, that match the evt's SdkEvent.Source property will be triggered. If there are no events being processed when this method is called, the event will be processed immediately. If there are already events being processed, or if this method is called as a side effect of an earlier call to Add, then the event will be enqueued and processed after all existing events have been processed.

Parameters
evtAny SdkEvent
Returns
A Promise<T> that will complete when the given evt's SdkEventConsumer's have finished processing the event.

Implements Beamable.Player.ISdkEventService.

◆ Process()

void Beamable.Player.SdkEventService.Process ( )
inline

This will be removed in a future version of Beamable, please do not use. The processing happens immediately when events are added via the Add method. There should never be a need to manually process the events.

Implements Beamable.Player.ISdkEventService.

◆ Register()

SdkEventConsumer Beamable.Player.SdkEventService.Register ( string  source,
SdkEventHandler  handler 
)
inline

Register a handler function that will trigger anytime an SdkEvent is processed that matches the given source argument.

Parameters
sourceSpecify which SdkEvent.Source value the handler will be called for.
handlerA function that consumes the SdkEvent, and produces a Promise. The processing of an SdkEvent won't complete until all the resulting promises complete.
Returns
A SdkEventConsumer that represents the registration of the handler on the source.

Implements Beamable.Player.ISdkEventService.

◆ Unregister()

void Beamable.Player.SdkEventService.Unregister ( SdkEventConsumer  consumer)
inline

Unregister a SdkEventConsumer so that the SdkEventHandler will not trigger for SdkEvent's of the given SdkEventConsumer.Source.

Parameters
consumerThe SdkEventConsumer instance to unregister. This must be the instance that was returned from the Register method.

Implements Beamable.Player.ISdkEventService.


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