Skip to main content

Class Event

Namespace: Consul
Assembly: Consul.dll

public class Event : IEventEndpoint

Inheritance​

object ← Event

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)

Parameters​

ue UserEvent

ct CancellationToken

Returns​

Task <WriteResult <string >>

Fire(UserEvent)​

public Task<WriteResult<string>> Fire(UserEvent ue)

Parameters​

ue UserEvent

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)

Parameters​

ct CancellationToken

Returns​

Task <QueryResult <UserEvent []>>

An array of events

List()​

public Task<QueryResult<UserEvent[]>> List()

Returns​

Task <QueryResult <UserEvent []>>

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)

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)​

public Task<QueryResult<UserEvent[]>> List(string name)

Parameters​

name string

Returns​

Task <QueryResult <UserEvent []>>

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)
    • Fire(UserEvent, WriteOptions, CancellationToken)
    • IDToIndex(string)
    • List(CancellationToken)
    • List()
    • List(string, CancellationToken)
    • List(string)
    • List(string, QueryOptions, CancellationToken)