Table of Contents

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

context PipeContext

The pipe context

Returns

TPayload

The payload, or throws a PayloadNotFoundException if the payload is not present

Type Parameters

TPayload

The 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

context PipeContext

The pipe context

defaultPayload TPayload

Returns

TPayload

The payload, or the default Value

Type Parameters

TPayload

The 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

pipe IPipe<T>

Returns

bool

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

pipe IPipe<T>

Returns

bool

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

context PipeContext

The pipe context

setupMethod Func<T, Task>

The setup method, called once regardless of the thread count

payloadFactory PayloadFactory<T>

The factory method for the payload context, optional if an interface is specified

Returns

Task

Type Parameters

T

The payload type, should be an interface