-
Notifications
You must be signed in to change notification settings - Fork 56
/
IFinalCommandWithRetryStep.cs
31 lines (30 loc) · 1.46 KB
/
IFinalCommandWithRetryStep.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Zeebe.Client.Api.Commands
{
public interface IFinalCommandWithRetryStep<T> : IFinalCommandStep<T>
{
/// <summary>
/// Sends the command with retry to the Zeebe broker. This operation is asynchronous. In case of success, the
/// task returns the event that was generated by the Zeebe broker in response to the command.
/// If the sending of the command fails, because of broker back pressure or network issues the request is
/// retried until the command succeeds. The wait time between retries can be configured on the
/// ZeebeClientBuilder. Per default the wait time is based on power two, which means 2^1 seconds, 2^2 seconds
/// etc. until it reaches the maximum of one minute.
///
/// <para>Use <c>await ...SendWithRetry();</c> to wait until the response is available.</para>
///
/// <example>
/// <code>
/// T response = await command.SendWithRetry();
/// </code>
/// </example>
/// </summary>
///
/// <param name="timeout">the time span after request should be timed out</param>
/// <param name="token">the token that manages the cancellation of the request.</param>
/// <returns>a task tracking state of success/failure of the command.</returns>
Task<T> SendWithRetry(TimeSpan? timeout = null, CancellationToken token = default);
}
}