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, IConfiguration, INeosTracer)
Initializes a new instance of the EventPublication class.
public EventPublication(DaprClient daprClient, IHttpContextAccessor httpContextAccessor, IUniqueIdentifierGenerator uniqueIdentifierGenerator, IApplicationContext applicationContext, INeosTenantInfoAccessor neosTenantInfoAccessor, IConfiguration configuration, INeosTracer neosTracer)
Parameters
daprClientDaprClientThe dapr client.
httpContextAccessorIHttpContextAccessorThe HTTP context accessor.
uniqueIdentifierGeneratorIUniqueIdentifierGeneratorThe unique identifier generator.
applicationContextIApplicationContextThe application context.
neosTenantInfoAccessorINeosTenantInfoAccessorNeos tenant info accessor.
configurationIConfigurationConfiguration settings.
neosTracerINeosTracerNeos tracer for tracing activities.
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
topicNamestringThe name of the topic the request should be published to.
dataTDataThe data that will be JSON serialized and provided as the event payload.
optionsPubSubOptionsA PubSubOptions for additionnal event configuration.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TDataThe 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
topicNamestringThe name of the topic the request should be published to.
dataTDataThe data that will be JSON serialized and provided as the event payload.
cancellationTokenCancellationTokenA CancellationToken that can be used to cancel the operation.
Returns
Type Parameters
TDataThe type of the data that will be JSON serialized and provided as the event payload.