Table of Contents

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 DaprClient

The dapr client.

httpContextAccessor IHttpContextAccessor

The HTTP context accessor.

uniqueIdentifierGenerator IUniqueIdentifierGenerator

The unique identifier generator.

applicationContext IApplicationContext

The application context.

neosTenantInfoAccessor INeosTenantInfoAccessor

Neos tenant info accessor.

Fields

NeosPubSubName

The name of the pub/sub component.

public const string NeosPubSubName = "neos-pubsub"

Field Value

string

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 string

The name of the topic the request should be published to.

data TData

The data that will be JSON serialized and provided as the event payload.

options PubSubOptions

A PubSubOptions for additionnal event configuration.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task

A Task that will complete when the operation has completed.

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 string

The name of the topic the request should be published to.

data TData

The data that will be JSON serialized and provided as the event payload.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task

A Task that will complete when the operation has completed.

Type Parameters

TData

The type of the data that will be JSON serialized and provided as the event payload.