Class Efl.LoopConsumer
An Efl.LoopConsumer is a class which requires one of the parents to provide an Efl.Loop interface when performing Efl.Object.FindProvider(System.Type). It will enforce this by only allowing parents which provide such an interface or NULL
.
(Since EFL 1.22)
Inheritance
Syntax
public abstract class LoopConsumer : Object, IWrapper, IDisposable
Constructors
LoopConsumer(EoWrapper.ConstructingHandle)
Subclasses should override this constructor if they are expected to be instantiated from native code. Do not call this constructor directly.
Declaration
protected LoopConsumer(EoWrapper.ConstructingHandle ch)
Parameters
Type | Name | Description |
---|---|---|
Efl.Eo.EoWrapper.ConstructingHandle | ch | Tag struct storing the native handle of the object being constructed. |
LoopConsumer(Object)
Initializes a new instance of the Efl.LoopConsumer class.
Declaration
public LoopConsumer(Object parent = null)
Parameters
Type | Name | Description |
---|---|---|
Efl.Object | parent | Parent instance. |
LoopConsumer(IntPtr, Object)
Initializes a new instance of the Efl.LoopConsumer class. Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.
Declaration
protected LoopConsumer(IntPtr baseKlass, Object parent)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | baseKlass | The pointer to the base native Eo class. |
Efl.Object | parent | The Efl.Object parent of this instance. |
Properties
Loop
The loop to which this object belongs to. (Since EFL 1.22)
Declaration
public Loop Loop { get; }
Property Value
Type | Description |
---|---|
Efl.Loop | Efl loop |
Methods
FutureRejected(Error)
Creates a new future that is already rejected to a specified error using the Efl.LoopConsumer.GetLoop(). This function creates a new future with an already known error, that will be resolved and dispatched by the loop scheduler as usual.
This is a helper that behaves the same as ref eina_future_rejected. (Since EFL 1.22)
Declaration
public virtual Future FutureRejected(Error error)
Parameters
Type | Name | Description |
---|---|---|
Eina.Error | error | An Eina_Error value |
Returns
Type | Description |
---|---|
Eina.Future | The future or |
FutureRejectedAsync(Error, CancellationToken)
Async wrapper for Efl.LoopConsumer.FutureRejected(Eina.Error).
Declaration
public Task<Value> FutureRejectedAsync(Error error, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Eina.Error | error | An Eina_Error value |
System.Threading.CancellationToken | token | Token to notify the async operation of external request to cancel. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Eina.Value> | An async task wrapping the result of the operation. |
FutureResolved(Value)
Creates a new future that is already resolved to a value. This function creates a new future with an already known value, that will be resolved and dispatched by the loop scheduler as usual.
This is a helper that behaves the same as eina_future_resolved. (Since EFL 1.22)
Declaration
public virtual Future FutureResolved(Value result)
Parameters
Type | Name | Description |
---|---|---|
Eina.Value | result | The value to be delivered. Note that the value contents must survive this function scope, that is, do not use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using ref eina_value_flush() once they are unused (no more future or futures returned a new value) |
Returns
Type | Description |
---|---|
Eina.Future | The future or |
FutureResolvedAsync(Value, CancellationToken)
Async wrapper for Efl.LoopConsumer.FutureResolved(Eina.Value).
Declaration
public Task<Value> FutureResolvedAsync(Value result, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Eina.Value | result | The value to be delivered. Note that the value contents must survive this function scope, that is, do not use stack allocated blobs, arrays, structures or types that keep references to memory you give. Values will be automatically cleaned up using ref eina_value_flush() once they are unused (no more future or futures returned a new value) |
System.Threading.CancellationToken | token | Token to notify the async operation of external request to cancel. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Eina.Value> | An async task wrapping the result of the operation. |
GetLoop()
Gets a handle to the loop. (Since EFL 1.22)
Declaration
public virtual Loop GetLoop()
Returns
Type | Description |
---|---|
Efl.Loop | Efl loop |
NewPromise()
Create a new promise with the scheduler coming from the loop provided by this object. Note: You should not use eina_promise_data_set as this function rely on controlling the promise data. (Since EFL 1.22)
Declaration
public virtual Promise NewPromise()
Returns
Type | Description |
---|---|
Eina.Promise | The new promise. |