Class EventPublication
- Namespace
- GroupeIsa.Neos.ClusterCommunication
- Assembly
- GroupeIsa.Neos.ClusterCommunication.dll
Represents an event publication.
public class EventPublication : IEventPublication
- Inheritance
-
EventPublication
- Implements
- Inherited Members
Constructors
EventPublication(DaprClient, IHttpContextAccessor, IUniqueIdentifierGenerator, IApplicationContext, INeosTenantInfoAccessor)
Initializes a new instance of the EventPublication class.
public EventPublication(DaprClient daprClient, IHttpContextAccessor httpContextAccessor, IUniqueIdentifierGenerator uniqueIdentifierGenerator, IApplicationContext applicationContext, INeosTenantInfoAccessor neosTenantInfoAccessor)
Parameters
daprClient
DaprClientThe dapr client.
httpContextAccessor
IHttpContextAccessorThe HTTP context accessor.
uniqueIdentifierGenerator
IUniqueIdentifierGeneratorThe unique identifier generator.
applicationContext
IApplicationContextThe application context.
neosTenantInfoAccessor
INeosTenantInfoAccessorNeos tenant info accessor.
Fields
NeosPubSubName
The name of the pub/sub component.
public const string NeosPubSubName = "neos-pubsub"
Field Value
Methods
PublishEventAsync<TData>(string, TData, PubSubOptions, CancellationToken)
Publish data to other Neos clusters.
public Task PublishEventAsync<TData>(string topicName, TData data, PubSubOptions options, CancellationToken cancellationToken = default)
Parameters
topicName
stringThe name of the topic the request should be published to.
data
TDataThe data that will be JSON serialized and provided as the event payload.
options
PubSubOptionsA PubSubOptions for additionnal event configuration.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TData
The type of the data that will be JSON serialized and provided as the event payload.
PublishEventAsync<TData>(string, TData, CancellationToken)
Publish data to other Neos clusters.
public Task PublishEventAsync<TData>(string topicName, TData data, CancellationToken cancellationToken = default)
Parameters
topicName
stringThe name of the topic the request should be published to.
data
TDataThe data that will be JSON serialized and provided as the event payload.
cancellationToken
CancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TData
The type of the data that will be JSON serialized and provided as the event payload.