Class PublishExecuteExtensions
- Namespace
- MassTransit
- Assembly
- MassTransit.Abstractions.dll
public static class PublishExecuteExtensions
- Inheritance
-
PublishExecuteExtensions
- Inherited Members
Methods
Publish(IPublishEndpoint, object, Action<PublishContext>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish(this IPublishEndpoint endpoint, object message, Action<PublishContext> callback, CancellationToken cancellationToken = default)
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
objectThe message
callback
Action<PublishContext>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Publish(IPublishEndpoint, object, Func<PublishContext, Task>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish(this IPublishEndpoint endpoint, object message, Func<PublishContext, Task> callback, CancellationToken cancellationToken = default)
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
objectThe message
callback
Func<PublishContext, Task>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Publish(IPublishEndpoint, object, Type, Action<PublishContext>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish(this IPublishEndpoint endpoint, object message, Type messageType, Action<PublishContext> callback, CancellationToken cancellationToken = default)
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
objectThe message
messageType
TypeThe message type to send the object as
callback
Action<PublishContext>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Publish(IPublishEndpoint, object, Type, Func<PublishContext, Task>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish(this IPublishEndpoint endpoint, object message, Type messageType, Func<PublishContext, Task> callback, CancellationToken cancellationToken = default)
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
objectThe message
messageType
TypeThe message type to send the object as
callback
Func<PublishContext, Task>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Publish<T>(IPublishEndpoint, object, Action<PublishContext<T>>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish<T>(this IPublishEndpoint endpoint, object values, Action<PublishContext<T>> callback, CancellationToken cancellationToken = default) where T : class
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
values
objectThe values that map to the object
callback
Action<PublishContext<T>>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Type Parameters
T
The message type
Publish<T>(IPublishEndpoint, object, Func<PublishContext<T>, Task>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish<T>(this IPublishEndpoint endpoint, object values, Func<PublishContext<T>, Task> callback, CancellationToken cancellationToken = default) where T : class
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
values
objectThe values that map to the object
callback
Func<PublishContext<T>, Task>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Type Parameters
T
The message type
Publish<T>(IPublishEndpoint, T, Action<PublishContext<T>>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish<T>(this IPublishEndpoint endpoint, T message, Action<PublishContext<T>> callback, CancellationToken cancellationToken = default) where T : class
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
TThe message
callback
Action<PublishContext<T>>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Type Parameters
T
The message type
Publish<T>(IPublishEndpoint, T, Func<PublishContext<T>, Task>, CancellationToken)
Publish a message, using a callback to modify the publish context instead of building a pipe from scratch
public static Task Publish<T>(this IPublishEndpoint endpoint, T message, Func<PublishContext<T>, Task> callback, CancellationToken cancellationToken = default) where T : class
Parameters
endpoint
IPublishEndpointThe endpoint to send the message
message
TThe message
callback
Func<PublishContext<T>, Task>The callback for the send context
cancellationToken
CancellationTokenTo cancel the send from happening
Returns
- Task
The task which is completed once the Send is acknowledged by the broker
Type Parameters
T
The message type
ToPipe(Action<PublishContext>)
public static IPipe<PublishContext> ToPipe(this Action<PublishContext> callback)
Parameters
callback
Action<PublishContext>
Returns
ToPipe(Func<PublishContext, Task>)
public static IPipe<PublishContext> ToPipe(this Func<PublishContext, Task> callback)
Parameters
callback
Func<PublishContext, Task>
Returns
ToPipe<T>(Action<PublishContext<T>>)
public static IPipe<PublishContext<T>> ToPipe<T>(this Action<PublishContext<T>> callback) where T : class
Parameters
callback
Action<PublishContext<T>>
Returns
- IPipe<PublishContext<T>>
Type Parameters
T
ToPipe<T>(Func<PublishContext<T>, Task>)
public static IPipe<PublishContext<T>> ToPipe<T>(this Func<PublishContext<T>, Task> callback) where T : class
Parameters
callback
Func<PublishContext<T>, Task>
Returns
- IPipe<PublishContext<T>>
Type Parameters
T