Interface INetworkRequestManager
- Namespace
- MADE.Networking.Http
- Assembly
- MADE.Networking.dll
Defines an interface for a network request manager.
public interface INetworkRequestManager
- Extension Methods
Properties
CurrentQueue
Gets the current queue of network requests.
ConcurrentDictionary<string, NetworkRequestCallback> CurrentQueue { get; }
Property Value
Methods
AddOrUpdate<TRequest, TResponse>(TRequest, Action<TResponse>)
Adds or updates a network request in the queue.
void AddOrUpdate<TRequest, TResponse>(TRequest request, Action<TResponse> successCallback) where TRequest : NetworkRequest
Parameters
requestTRequestThe network request to execute.
successCallbackAction<TResponse>The action to execute when receiving a successful response.
Type Parameters
TRequestThe type of network request.
TResponseThe expected response type.
AddOrUpdate<TRequest, TResponse, TErrorResponse>(TRequest, Action<TResponse>, Action<TErrorResponse>)
Adds or updates a network request in the queue.
void AddOrUpdate<TRequest, TResponse, TErrorResponse>(TRequest request, Action<TResponse> successCallback, Action<TErrorResponse> errorCallback) where TRequest : NetworkRequest
Parameters
requestTRequestThe network request to execute.
successCallbackAction<TResponse>The action to execute when receiving a successful response.
errorCallbackAction<TErrorResponse>The action to execute when receiving an error response.
Type Parameters
TRequestThe type of network request.
TResponseThe expected response type.
TErrorResponseThe expected error response type.
ProcessCurrentQueueAsync()
Processes the current queue of network requests.
Task ProcessCurrentQueueAsync()
Returns
- Task
An asynchronous operation.
Remove(INetworkRequest)
Removes a network request from the queue.
If the request is no longer in the queue, this method does nothing.
void Remove(INetworkRequest request)
Parameters
requestINetworkRequestThe request to remove from the queue.
RemoveByKey(string)
Removes a network request from the queue by the registered key identifier.
If the request is no longer in the queue, this method does nothing.
void RemoveByKey(string key)
Parameters
keystringThe key corresponding to the network request to remove from the queue.
Start()
Starts the manager processing the queue of network requests at a default time period of 1 minute.
void Start()
Start(TimeSpan)
Starts the manager processing the queue of network requests.
void Start(TimeSpan processPeriod)
Parameters
processPeriodTimeSpanThe time period between each process of the queue.
Stop()
Stops the processing of the network manager queues.
void Stop()