Interface IUpdateStreamBuilder
Builder for IUpdateStream<TValue> to use for updating a specific topic. A builder is created using NewUpdateStreamBuilder().
Namespace: PushTechnology.ClientInterface.Client.Features
Assembly: Diffusion.Client.dll
Syntax
public interface IUpdateStreamBuilder
Remarks
The type of the topic being updated must match the type of values.
Since 6.9.
Methods
Build<TValue>(String)
Creates an IUpdateStream<TValue> to use for updating a specific topic.
Declaration
IUpdateStream<TValue> Build<TValue>(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the topic. |
Returns
Type | Description |
---|---|
IUpdateStream<TValue> | An update stream. |
Type Parameters
Name | Description |
---|---|
TValue | Type of the values expected by the update stream. |
Remarks
The type of the topic being updated must match the type of values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks (see ISessionLock) as constraints.
Streams are validated lazily when the first SetAsync(TValue) or ValidateAsync() operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
Build<TValue>(String, RetryStrategy)
Creates a IRecoverableUpdateStream<TValue> to use for updating a specific topic.
Declaration
IRecoverableUpdateStream<TValue> Build<TValue>(string path, RetryStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
String | path | The path of the topic. |
RetryStrategy | strategy | A retry strategy definition. |
Returns
Type | Description |
---|---|
IRecoverableUpdateStream<TValue> | A recoverable update stream. |
Type Parameters
Name | Description |
---|---|
TValue | Type of the values expected by the update stream. |
Remarks
Takes a retry strategy that governs recovery attempts following a recoverable exception.
In other respects this method works in the same way as Build<TValue>(String).
Constraint(IUpdateConstraint)
Specifies an update constraint for this update stream.
Declaration
IUpdateStreamBuilder Constraint(IUpdateConstraint updateConstraint)
Parameters
Type | Name | Description |
---|---|---|
IUpdateConstraint | updateConstraint | The constraint that must be satisfied for the update stream to be validated. |
Returns
Type | Description |
---|---|
IUpdateStreamBuilder | This builder. |
Remarks
Constraints can be created using an IUpdateConstraintFactory, an instance of which can be obtained using UpdateConstraints.
Constraints can be applied to the setting of a value and creation of an update stream. Constraints describe a condition that must be satisfied for the operation to succeed. The constraints are evaluated on the server. The available constraints are: an active session lock, the absence of a topic, the current value of the topic being updated, and a part of the current value of the topic being updated.
Constraint is Unconstrained by default. Calling this method with a null parameter resets the constraint for this builder.
Reset()
Resets the builder to its default parameters.
Declaration
IUpdateStreamBuilder Reset()
Returns
Type | Description |
---|---|
IUpdateStreamBuilder | This builder. |
Specification(ITopicSpecification)
Specifies an ITopicSpecification for this update stream.
Declaration
IUpdateStreamBuilder Specification(ITopicSpecification topicSpecification)
Parameters
Type | Name | Description |
---|---|---|
ITopicSpecification | topicSpecification | The required specification of the topic. |
Returns
Type | Description |
---|---|
IUpdateStreamBuilder | This builder. |
Remarks
If a topic does not exist at the path
one will be created using
the topicSpecification
when the update stream is validated. If a
topic does exist, its specification must match topicSpecification
,
otherwise the operation will fail with
IncompatibleTopicException.
Specification is null by default. Calling this method with a null parameter resets the specification for this builder.