-
Notifications
You must be signed in to change notification settings - Fork 2
Options
Meyn edited this page Dec 15, 2025
·
4 revisions
$\text{\color{orange}I\color{none}RequestOptions<\color{green}TCompleated\color{none},\color{red}TFailed\color{none}>}$
The IRequestOptions<> interface serves as a blueprint for defining properties and methods necessary for a Request<>. It is a generic interface, allowing for two type parameters:
-
$\text{\color{green}TCompleated}$ : Type: None- Represents the return type when the
Request<>completes successfully.
- Represents the return type when the
-
$\text{\color{red}TFailed}$ : Type: None- Represents the return type when the
Request<>fails to run successfully after all retries.
- Represents the return type when the
-
AutoStart: Type:
bool- Set if the
Request<>should start on initialization.
- Set if the
-
Priority: Type:
RequestPriority- Sets the priority of the
Request<>.
- Sets the priority of the
-
DeployDelay: Type:
Nullable<TimeSpan>- Sets the time a
Request<>should wait after Start to be deployed.
- Sets the time a
-
Handler: Type:
RequestHandler- Sets the
RequestHandlerinstance for theRequest<>.
- Sets the
-
NumberOfAttempts: Type:
byte- Sets the number of times an instance of
Request<>should retry on failure.
- Sets the number of times an instance of
-
DelayBetweenAttempts: Type:
Nullable<TimeSpan>- Sets the delay between retries of a
Request<>.
- Sets the delay between retries of a
-
CancellationToken: Type:
Nullable<CancellationToken>- Sets a
CancellationTokeninstance that will be linked with theRequest<>. If canceled, the request will also be canceled.
- Sets a
-
RequestCancelled: Type:
Nullable<Notify<IRequest>>- Event that is going to be invoked when the
Request<>is canceled.
- Event that is going to be invoked when the
-
RequestStarted: Type:
Nullable<Notify<IRequest>>- Event that is going to be invoked when the
Request<>starts.
- Event that is going to be invoked when the
-
RequestCompleted: Type:
Nullable<Notify<IRequest, TCompleted>>- Event that is going to be invoked when the
Request<>is completed successfully.
- Event that is going to be invoked when the
-
RequestFailed: Type:
Nullable<Notify<IRequest, TFailed>>- Event that is going to be invoked when the
Request<>fails.
- Event that is going to be invoked when the
$\text{RequestOptions<\color{green}TCompleated\color{none},\color{red}TFailed\color{none}>}$ Record
The RequestOptions<> record provides the functionalities of IRequestOptions<>. It inherits from IRequestOptions<> and includes its generic parameters.
-
$\text{\color{green}TCompleated}$ : Type: None- Represents the return type when the
Request<>completes successfully.
- Represents the return type when the
-
$\text{\color{red}TFailed}$ : Type: None- Represents the return type when the
Request<>fails to run successfully after all retries.
- Represents the return type when the
-
AutoStart: Type:
bool- Set if the
Request<>should start on initialization.
- Set if the
-
Priority: Type:
RequestPriority- Sets the priority of the
Request<>.
- Sets the priority of the
-
DeployDelay: Type:
Nullable<TimeSpan>- Sets the time a
Request<>should wait after Start to be deployed.
- Sets the time a
-
Handler: Type:
RequestHandler- Sets the
RequestHandlerinstance for theRequest<>.
- Sets the
-
NumberOfAttempts: Type:
byte- Sets the number of times an instance of
Request<>should retry on failure.
- Sets the number of times an instance of
-
DelayBetweenAttempts: Type:
Nullable<TimeSpan>- Sets the delay between retries of a
Request<>.
- Sets the delay between retries of a
-
CancellationToken: Type:
Nullable<CancellationToken>- Sets a
CancellationTokeninstance that will be linked with theRequest<>. If canceled, the request will also be canceled.
- Sets a
-
RequestCancelled: Type:
Nullable<Notify<IRequest>>- Event that is going to be invoked when the
Request<>is canceled.
- Event that is going to be invoked when the
-
RequestStarted: Type:
Nullable<Notify<IRequest>>- Event that is going to be invoked when the
Request<>starts.
- Event that is going to be invoked when the
-
RequestCompleted: Type:
Nullable<Notify<IRequest, TCompleated>>- Event that is going to be invoked when the
Request<>is completed successfully.
- Event that is going to be invoked when the
-
RequestFailed: Type:
Nullable<Notify<IRequest, TFailed>>- Event that is going to be invoked when the
Request<>fails.
- Event that is going to be invoked when the
-
Constructor:
- Creates a
RequestOptions<>object.
- Creates a
-
protectedConstructor:- Copy constructor for the
RequestOptions<>record.
- Copy constructor for the
The RequestState enum defines the various states for an IRequest.
-
Idle:
- The
IRequesthas been started but has not yet been processed by theRequestHandler.
- The
-
Running:
- The
IRequestis currently running.
- The
-
Completed:
- The
IRequesthas successfully completed.
- The
-
Paused:
- The
IRequestis in a paused state.
- The
-
Waiting:
- The
IRequestis waiting to be deployed after being started.
- The
-
Cancelled:
- The
IRequestwas canceled.
- The
-
Failed:
- The
IRequestfailed all retry attempts.
- The
The RequestPriority enum outlines the priority states for an IRequest.
-
High:
- The
IRequestwill be processed first.
- The
-
Normal:
- The
IRequestwill be processed after high but before low.
- The
-
Low:
- The
IRequestwill be processed last.
- The
The NotifyDelegates collection includes various delegate types for notifying listeners. These delegates serve different purposes, such as event handling and passing data. They enhance code modularity and communication for IRequest.
-
VoidStruct:
- A simple struct with no fields or methods.
-
NotifyVoid:
- A delegate that has no return type or parameters.
-
Notify<T>:
- A generic delegate with no return type but a generic parameter.
- Type parameter:
T(can be any type). - Method signature:
void Notify<T>(T? element).
-
Notify<T0, T1>:
- A generic delegate with no return type but two generic parameters.
- Type parameters:
T0andT1(can be any types). - Method signature:
void Notify<T0, T1>(T0? element0, T1? element1).