HttpWorker<K> class abstract

This is the base class for all the workers that process the requests. This can be extended to create your own implementation for processing requests.

For example, you can create a HttpWorker that processes requests on a pool of Isolates with an implementation of load balancer to balance the request across Isolates.

Implementers

Constructors

HttpWorker()
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

destroy() → dynamic
Function to destroy the worker. Currently, this is not used in this library. But, you can call this function from your application if you have access to the HttpWorker object to destroy it.
init({Uri? baseUrl}) Future
This method is called before any requests are processed. This can be used to complete any initialisation needed before the worker can call processRequest.
killRequest(K id) Future
Function to cancel the request with the given id.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processRequest<T>({required K id, required RequestMethod method, required Uri url, Map<String, String>? header, Object? body, Parser<T>? parser, Map<String, Object?>? meta}) → (Completer<Response<T>>, {Object? meta})
Function to process the request. This function should return a Completer with Response as the future.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited