Class EventReceiver
Creates an event receiver that is used to receive events from an EventKey
public sealed class EventReceiver : EventReceiverBase<bool>, IDisposable
- Inheritance
-
EventReceiver
- Implements
- Inherited Members
- Extension Methods
Constructors
EventReceiver(EventKey, EventReceiverOptions)
Initializes a new instance of the EventReceiver class. Creates an event receiver, ready to receive broadcasts from the key.
public EventReceiver(EventKey key, EventReceiverOptions options = EventReceiverOptions.None)
Parameters
key
EventKeyThe event key to listen from
options
EventReceiverOptionsOption flags
Methods
ReceiveAsync()
Awaits a single event
public Task ReceiveAsync()
Returns
ReceiveOne(params EventReceiverBase[])
Combines multiple receivers in one call and tries to receive the first available events among all the passed receivers
public static Task<EventData> ReceiveOne(params EventReceiverBase[] events)
Parameters
events
EventReceiverBase[]The events you want to listen to
Returns
TryReceive()
Receives one event from the buffer, useful specially in Sync scripts
public bool TryReceive()
Returns
TryReceiveAll()
Receives all the events from the queue (if buffered was true during creations), useful mostly only in Sync scripts
public int TryReceiveAll()