Class PipeToSupport
Creates the PipeTo pattern for automatically sending the results of completed tasks into the inbox of a designated Actor
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public static class PipeToSupport
Methods
| Improve this Doc View SourcePipeTo(Task, ICanTell, IActorRef, Func<Object>, Func<Exception, Object>)
Pipes the output of a Task directly to the recipient
's mailbox once
the task completes. As this task has no result, only exceptions will be piped to the recipient
Declaration
public static Task PipeTo(this Task taskToPipe, ICanTell recipient, IActorRef sender = null, Func<object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
Task | taskToPipe | The Task that result needs to be piped to an actor |
ICanTell | recipient | The actor that will receive the Task result |
IActorRef | sender | The IActorRef that will be used as the sender of the result. Defaults to Nobody |
Func<Object> | success | A callback function that will be called on Task success. Defaults to |
Func<Exception, Object> | failure | A callback function that will be called on Task failure. Defaults to |
Returns
Type | Description |
---|---|
Task | A detached task |
PipeTo(Task, ICanTell, Boolean, IActorRef, Func<Object>, Func<Exception, Object>)
Pipes the output of a Task directly to the recipient
's mailbox once
the task completes. As this task has no result, only exceptions will be piped to the recipient
Declaration
public static async Task PipeTo(this Task taskToPipe, ICanTell recipient, bool useConfigureAwait, IActorRef sender = null, Func<object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
Task | taskToPipe | The Task that result needs to be piped to an actor |
ICanTell | recipient | The actor that will receive the Task result |
Boolean | useConfigureAwait | Sets the |
IActorRef | sender | The IActorRef that will be used as the sender of the result. Defaults to Nobody |
Func<Object> | success | A callback function that will be called on Task success. Defaults to |
Func<Exception, Object> | failure | A callback function that will be called on Task failure. Defaults to |
Returns
Type | Description |
---|---|
Task | A detached task |
PipeTo(ValueTask, ICanTell, IActorRef, Func<Object>, Func<Exception, Object>)
Declaration
public static Task PipeTo(this ValueTask taskToPipe, ICanTell recipient, IActorRef sender = null, Func<object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.ValueTask | taskToPipe | |
ICanTell | recipient | |
IActorRef | sender | |
Func<Object> | success | |
Func<Exception, Object> | failure |
Returns
Type | Description |
---|---|
Task |
PipeTo(ValueTask, ICanTell, Boolean, IActorRef, Func<Object>, Func<Exception, Object>)
Declaration
public static async Task PipeTo(this ValueTask taskToPipe, ICanTell recipient, bool useConfigureAwait, IActorRef sender = null, Func<object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.ValueTask | taskToPipe | |
ICanTell | recipient | |
Boolean | useConfigureAwait | |
IActorRef | sender | |
Func<Object> | success | |
Func<Exception, Object> | failure |
Returns
Type | Description |
---|---|
Task |
PipeTo<T>(Task<T>, ICanTell, IActorRef, Func<T, Object>, Func<Exception, Object>)
Pipes the output of a Task directly to the recipient
's mailbox once
the task completes
Declaration
public static Task PipeTo<T>(this Task<T> taskToPipe, ICanTell recipient, IActorRef sender = null, Func<T, object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
Task<T> | taskToPipe | The Task that result needs to be piped to an actor |
ICanTell | recipient | The actor that will receive the Task result |
IActorRef | sender | The IActorRef that will be used as the sender of the result. Defaults to Nobody |
Func<T, Object> | success | A callback function that will be called on Task success. Defaults to |
Func<Exception, Object> | failure | A callback function that will be called on Task failure. Defaults to |
Returns
Type | Description |
---|---|
Task | A detached task |
Type Parameters
Name | Description |
---|---|
T | The type of result of the Task |
PipeTo<T>(Task<T>, ICanTell, Boolean, IActorRef, Func<T, Object>, Func<Exception, Object>)
Pipes the output of a Task directly to the recipient
's mailbox once
the task completes
Declaration
public static async Task PipeTo<T>(this Task<T> taskToPipe, ICanTell recipient, bool useConfigureAwait, IActorRef sender = null, Func<T, object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
Task<T> | taskToPipe | The Task that result needs to be piped to an actor |
ICanTell | recipient | The actor that will receive the Task result |
Boolean | useConfigureAwait | Sets the |
IActorRef | sender | The IActorRef that will be used as the sender of the result. Defaults to Nobody |
Func<T, Object> | success | A callback function that will be called on Task success. Defaults to |
Func<Exception, Object> | failure | A callback function that will be called on Task failure. Defaults to |
Returns
Type | Description |
---|---|
Task | A detached task |
Type Parameters
Name | Description |
---|---|
T | The type of result of the Task |
PipeTo<T>(ValueTask<T>, ICanTell, IActorRef, Func<T, Object>, Func<Exception, Object>)
Declaration
public static Task PipeTo<T>(this ValueTask<T> taskToPipe, ICanTell recipient, IActorRef sender = null, Func<T, object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.ValueTask<T> | taskToPipe | |
ICanTell | recipient | |
IActorRef | sender | |
Func<T, Object> | success | |
Func<Exception, Object> | failure |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
T |
PipeTo<T>(ValueTask<T>, ICanTell, Boolean, IActorRef, Func<T, Object>, Func<Exception, Object>)
Declaration
public static async Task PipeTo<T>(this ValueTask<T> taskToPipe, ICanTell recipient, bool useConfigureAwait, IActorRef sender = null, Func<T, object> success = null, Func<Exception, object> failure = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.ValueTask<T> | taskToPipe | |
ICanTell | recipient | |
Boolean | useConfigureAwait | |
IActorRef | sender | |
Func<T, Object> | success | |
Func<Exception, Object> | failure |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
T |