Interface ISessionOpenContextCallback<TContext>
- Namespace
- PushTechnology.ClientInterface.Client.Session
- Assembly
- Diffusion.Client.dll
The callback interface for non-blocking opening of sessions.
[Obsolete("Deprecated since 6.12. Use ISessionFactory.OpenAsync instead. This interface will be removed in a future release.")]
public interface ISessionOpenContextCallback<in TContext> : IContextCallback<TContext>
Type Parameters
TContextThe context type.
- Inherited Members
Examples
An example implementation for the callback with a context of type System.Int32.
class SessionOpenCallback : ISessionOpenContextCallback<int> {
public void OnError( int context, ErrorReason errorReason ) {
// TODO: Handle session open error in here.
}
public void OnOpened( int context, ISession session ) {
// TODO: Handle opened session in here.
}
}
Remarks
This is used when a session is opened using Open<TContext>(string, TContext, ISessionOpenContextCallback<TContext>).
It is guaranteed that one and only one of the callback methods will be called.
An arbitrary
TContext
object will be attached to callback notifications.
Caution
Deprecated since 6.12. Use the new OpenAsync() instead. This interface will be removed in a future release.
Added in 5.3.
Methods
OnOpened(TContext, ISession)
Called when a session has been successfully opened.
void OnOpened(TContext context, ISession session)
Parameters
contextTContextThe context object supplied when making the call.
sessionISessionThe opened session instance.
Remarks
Added in 5.3.