Interface IContextCallback<TContext>

The callback interface that provides responses from the server, together with a context object supplied by the application.

Namespace: PushTechnology.ClientInterface.Client.Callbacks
Assembly: Diffusion.Client.dll
Syntax
public interface IContextCallback<in TContext>
Type Parameters
Name Description
TContext

The context object type.

Remarks

Caution

Deprecated since 6.7. Methods that use contextual callbacks are deprecated and will be removed in a future release. Use a Task instead.

This interface and its extensions are alternatives to the ICallback interface hierarchy that allow the application to associate an arbitrary context object with each call. Any suitable application object can be provided as the context. It will be passed on to the corresponding callback methods, allowing requests and responses to be correlated. The context object is optional (it may be null).

In all other respects this interface and ICallback behave identically.

Since 5.1

Methods

OnError(TContext, ErrorReason)

Notification of a contextual error related to this callback.

Declaration
void OnError(TContext context, ErrorReason errorReason)
Parameters
Type Name Description
TContext context

The context object supplied when making the call. May be null.

ErrorReason errorReason

The reason for the error.

Remarks

This is analogous to an exception being raised. Situations in which this method is called include the session being closed, a communication timeout, or a problem with the provided parameters. No further calls will be made to this callback for the call context.

Back to top