/// <summary> /// Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. /// This handler(<see cref="Func{IMessageSession, Message, CancellationToken, Task}"/>) is awaited on every time a new message is received by the queue client. /// </summary> /// <param name="handler">A <see cref="Func{IMessageSession, Message, CancellationToken, Task}"/> that processes messages. /// cref="IMessageSession"/> contains the session information, and must be used to perform Complete/Abandon/Deadletter or other such operations on the <see cref="ServiceBusMessage"/></param> /// <param name="sessionHandlerOptions">Options used to configure the settings of the session pump.</param> /// <remarks>Enable prefetch to speed up the receive rate. </remarks> public void RegisterSessionHandler(Func <SessionReceiverClient, ServiceBusMessage, CancellationToken, Task> handler, SessionHandlerOptions sessionHandlerOptions) { // TODO remove if won't be used }
/// <summary> /// Receive session messages continuously from the queue. Registers a message handler and begins a new thread to receive session-messages. /// This handler(<see cref="Func{IMessageSession, Message, CancellationToken, Task}"/>) is awaited on every time a new message is received by the queue client. /// </summary> /// <param name="handler">A <see cref="Func{IMessageSession, Message, CancellationToken, Task}"/> that processes messages. /// cref="IMessageSession"/> contains the session information, and must be used to perform Complete/Abandon/Deadletter or other such operations on the <see cref="ServiceBusMessage"/></param> /// <param name="exceptionReceivedHandler">A <see cref="Func{T1, TResult}"/> that is invoked during exceptions. /// <see cref="ExceptionReceivedEventArgs"/> contains contextual information regarding the exception.</param> /// <remarks>Enable prefetch to speed up the receive rate. /// Use cref="RegisterSessionHandler(Func{IMessageSession,Message,CancellationToken,Task}, SessionHandlerOptions)"/> to configure the settings of the pump.</remarks> // TODO remove if won't be used public void RegisterSessionHandler(Func <SessionReceiverClient, ServiceBusMessage, CancellationToken, Task> handler, Func <ExceptionReceivedEventArgs, Task> exceptionReceivedHandler) { var sessionHandlerOptions = new SessionHandlerOptions(exceptionReceivedHandler); this.RegisterSessionHandler(handler, sessionHandlerOptions); }