
C# |
public sealed class SessionCallback

All Members | Constructors | Methods | Events | ||
Icon | Member | Description |
---|---|---|
![]() | SessionCallback()()()() | Initializes a new instance of the SessionCallback class |
![]() | __dtor()()()() | |
![]() | OnException | This event is triggered when an exception occurs within the scope of the given Session. Its handler must be implemented by the application developer.
NOTE: Although the Symphony API currently invokes this method with a single callback thread, the number of threads used by the API to invoke this method may increase in future revisions of the API. Therefore, the developer should never assume that the invocation of this method will be done serially and should always implement this method in a thread-safe manner. |
![]() | OnResponse | This event is triggered when a task response is available. Its handler must be implemented by the application developer.
A task response can be an output result (in the event of success of a task) or an exception (in the event of a task failure).
NOTE: Although the Symphony API currently invokes this method with a single callback thread, the number of threads used by the API to invoke this method may increase in future revisions of the API. Therefore, the developer should never assume that the invocation of this method will be done serially and should always implement this method in a thread-safe manner. |

The SessionCallback should be supplied as an argument when creating or opening a Session. The callback will be invoked whenever a task belonging to the given Session has completed or returned with error.
The SessionCallback will provide the most efficient use of the middleware (as opposed to synchronous task retrieval using Session.FetchTaskOutput).
IMPORTANT NOTE:1. To avoid missing any events, you must register your event handlers before creating or opening your Session.
2. If any of the methods of this class are called after the Main(...) method exits, the client or service process may behave in an undefined manner (for example, hang or terminate abnormally).

Object | |
![]() | SessionCallback |

[Platform.Symphony.Soam.Connection.OpenSession]