Table of Contents

Class EventReceiver

Namespace
Stride.Engine.Events
Assembly
Stride.Engine.dll

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 EventKey

The event key to listen from

options EventReceiverOptions

Option flags

Methods

ReceiveAsync()

Awaits a single event

public Task ReceiveAsync()

Returns

Task

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

Task<EventData>

TryReceive()

Receives one event from the buffer, useful specially in Sync scripts

public bool TryReceive()

Returns

bool

TryReceiveAll()

Receives all the events from the queue (if buffered was true during creations), useful mostly only in Sync scripts

public int TryReceiveAll()

Returns

int