Skip to the content.

PipeAndFilter API:EventPipe

Build License NuGet Downloads

Back to List Api

EventPipe<T>

Namespace: PipeFilterCore

Represents a pipe/task event with parameters, values ​​and commands.

public class EventPipe<T>

Type Parameters

T
Type of contract.

Inheritance ObjectEventPipe<T>

Properties

CorrelationId

The Correlation Id.

public string CorrelationId { get; }

Property Value

String

CurrentAlias

The current Alias.

public string CurrentAlias { get; }

Property Value

String

FromAlias

The previous Alias.

public string FromAlias { get; }

Property Value

String

Logger

The log handler.

public ILogger Logger { get; }

Property Value

ILogger

Constructors

EventPipe(String, ILogger, Action<Action<T>>, ImmutableDictionary<String, String>, String, String, String, String)

Create instance of Event-Pipe (Only internal use or Unit-Test).

public EventPipe(string cid, ILogger logger, Action<Action<T>> changecontract, ImmutableDictionary<String, String> savedvalues, string fromId, string currentId, string fromAlias, string currentAlias)

Parameters

cid String
The correlation Id.

logger ILogger
Handle of log.

changecontract Action<Action<T>>
Handle of changecontract.

savedvalues ImmutableDictionary<String, String>
The values saved.

fromId String
The previous Id.

currentId String
The current Id.

fromAlias String
The previous alias.

currentAlias String
The current alias.

Methods

EndPipeAndFilter()

End PipeAndFilter.

public void EndPipeAndFilter()

RemoValueAtEnd(String)

Remove a value associated with a unique key at the end of this event (If this event is not a task event).
Values ​​removed in the task event will only take effect in the pipe aggregation event
A task event cannot see values ​​saved and/or removed by another task.
In a task event, Never try to overwrite a value already saved by another event, the results may not be as expected as the execution sequence is not guaranteed.

public void RemoValueAtEnd(string id)

Parameters

id String
The unique key Id.

SaveValueAtEnd<T1>(String, T1)

Save/replace a value associated with a unique key at the end of this event(If this event is not a task event).
Values ​​saved in the task event will only take effect in the pipe aggregation event
A task event cannot see values ​​saved and/or removed by another task.
In a task event, Never try to overwrite a value already saved by another event, the results may not be as expected as the execution sequence is not guaranteed.
The values ​​will serialize into json.

public void SaveValueAtEnd<T1>(string id, T1 value)

Type Parameters

T1
Type value to save.

Parameters

id String
The unique key Id.

value T1
The value to save.

ThreadSafeAccess(Action<T>)

Thread Safe Access of contract.
The action will only be executed if the contract exists(not null).

public void ThreadSafeAccess(Action<T> action)

Parameters

action Action<T>
The action to access.
The action will only be executed if the contract exists(not null).

TrySavedValue(String, ref String)

Try get value saved ​​associated with a unique key.
The values ​​are serialized in json.
Null result may exist.

public bool TrySavedValue(string id, ref String value)

Parameters

id String
The unique key Id.

value String&
The value saved if any.

Returns

True if value exists, otherwise false with null value


Back to List Api