Table of Contents

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

ConcurrentDictionary<string, NetworkRequestCallback>

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

request TRequest

The network request to execute.

successCallback Action<TResponse>

The action to execute when receiving a successful response.

Type Parameters

TRequest

The type of network request.

TResponse

The 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

request TRequest

The network request to execute.

successCallback Action<TResponse>

The action to execute when receiving a successful response.

errorCallback Action<TErrorResponse>

The action to execute when receiving an error response.

Type Parameters

TRequest

The type of network request.

TResponse

The expected response type.

TErrorResponse

The 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

request INetworkRequest

The 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

key string

The 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

processPeriod TimeSpan

The time period between each process of the queue.

Stop()

Stops the processing of the network manager queues.

void Stop()