Class Event
Namespace: Consul
Assembly: Consul.dll
public class Event : IEventEndpoint
Inheritance
Implements
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
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
Customized write options
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
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
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
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
Customized query options
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