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

Public Member Functions

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.ISdkEventService.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.

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

Implemented in Beamable.Player.SdkEventService.

◆ Process()

void Beamable.Player.ISdkEventService.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.

Implemented in Beamable.Player.SdkEventService.

◆ Register()

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

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.

Implemented in Beamable.Player.SdkEventService.

◆ Unregister()

void Beamable.Player.ISdkEventService.Unregister ( SdkEventConsumer  consumer)

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.

Implemented in Beamable.Player.SdkEventService.


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