Class PipeExtensions
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
public static class PipeExtensions
- Inheritance
-
PipeExtensions
- Inherited Members
Methods
GetPayload<TPayload>(PipeContext)
Get a payload from the pipe context
public static TPayload GetPayload<TPayload>(this PipeContext context) where TPayload : class
Parameters
contextPipeContextThe pipe context
Returns
- TPayload
The payload, or throws a PayloadNotFoundException if the payload is not present
Type Parameters
TPayloadThe payload type
GetPayload<TPayload>(PipeContext, TPayload)
Get a payload from the pipe context
public static TPayload GetPayload<TPayload>(this PipeContext context, TPayload defaultPayload) where TPayload : class
Parameters
contextPipeContextThe pipe context
defaultPayloadTPayload
Returns
- TPayload
The payload, or the default Value
Type Parameters
TPayloadThe payload type
IsEmpty<T>(IPipe<T>?)
Returns true if the pipe is empty
public static bool IsEmpty<T>(this IPipe<T>? pipe) where T : class, PipeContext
Parameters
pipeIPipe<T>
Returns
Type Parameters
T
IsNotEmpty<T>(IPipe<T>?)
Returns true if the pipe is not empty
public static bool IsNotEmpty<T>(this IPipe<T>? pipe) where T : class, PipeContext
Parameters
pipeIPipe<T>
Returns
Type Parameters
T
OneTimeSetup<T>(PipeContext, Func<T, Task>, PayloadFactory<T>)
Using a filter-supplied context type, block so that the one time code is only executed once regardless of how many threads are pushing through the pipe at the same time.
public static Task OneTimeSetup<T>(this PipeContext context, Func<T, Task> setupMethod, PayloadFactory<T> payloadFactory) where T : class
Parameters
contextPipeContextThe pipe context
setupMethodFunc<T, Task>The setup method, called once regardless of the thread count
payloadFactoryPayloadFactory<T>The factory method for the payload context, optional if an interface is specified
Returns
Type Parameters
TThe payload type, should be an interface