Skip to main content

Class Event

Namespace: Consul
Assembly: Consul.dll

public class Event : IEventEndpoint

Inheritance

objectEvent

Implements

IEventEndpoint

Inherited Members

object.Equals(object) , object.Equals(object, object) , object.GetHashCode() , object.GetType() , object.MemberwiseClone() , object.ReferenceEquals(object, object) , object.ToString()

Methods

Fire(UserEvent, CancellationToken)

public Task<WriteResult<string>> Fire(UserEvent ue, CancellationToken ct = default)

Parameters

ue UserEvent

ct CancellationToken

Returns

Task <WriteResult <string >>

Fire(UserEvent, WriteOptions, CancellationToken)

Fire is used to fire a new user event. Only the Name, Payload and Filters are respected. This returns the ID or an associated error. Cross DC requests are supported.

public Task<WriteResult<string>> Fire(UserEvent ue, WriteOptions q, CancellationToken ct = default)

Parameters

ue UserEvent

A User Event definition

q WriteOptions

Customized write options

ct CancellationToken

The cancellation token

Returns

Task <WriteResult <string >>

IDToIndex(string)

IDToIndex is a bit of a hack. This simulates the index generation to convert an event ID into a WaitIndex.

public ulong IDToIndex(string uuid)

Parameters

uuid string

The Event UUID

Returns

ulong

A "wait index" generated from the UUID

List(CancellationToken)

List is used to get the most recent events an agent has received. This list can be optionally filtered by the name. This endpoint supports quasi-blocking queries. The index is not monotonic, nor does it provide provide LastContact or KnownLeader.

public Task<QueryResult<UserEvent[]>> List(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task <QueryResult <UserEvent []>>

An array of events

List(string, CancellationToken)

List is used to get the most recent events an agent has received. This list can be optionally filtered by the name. This endpoint supports quasi-blocking queries. The index is not monotonic, nor does it provide provide LastContact or KnownLeader.

public Task<QueryResult<UserEvent[]>> List(string name, CancellationToken ct = default)

Parameters

name string

The name of the event to filter for

ct CancellationToken

The cancellation token

Returns

Task <QueryResult <UserEvent []>>

An array of events

List(string, QueryOptions, CancellationToken)

List is used to get the most recent events an agent has received. This list can be optionally filtered by the name. This endpoint supports quasi-blocking queries. The index is not monotonic, nor does it provide provide LastContact or KnownLeader.

public Task<QueryResult<UserEvent[]>> List(string name, QueryOptions q, CancellationToken ct)

Parameters

name string

The name of the event to filter for

q QueryOptions

Customized query options

ct CancellationToken

Cancellation token for long poll request. If set, OperationCanceledException will be thrown if the request is cancelled before completing

Returns

Task <QueryResult <UserEvent []>>

An array of events

  • Methods
    • Fire(UserEvent, CancellationToken)
    • Fire(UserEvent, WriteOptions, CancellationToken)
    • IDToIndex(string)
    • List(CancellationToken)
    • List(string, CancellationToken)
    • List(string, QueryOptions, CancellationToken)