koi_net.components.request_handler

Classes

RequestHandler(log, cache, identity, ...)

Handles making requests to other KOI nodes.

class koi_net.components.request_handler.RequestHandler(log, cache, identity, secure_manager, error_handler)[source]

Bases: object

Handles making requests to other KOI nodes.

Parameters:
broadcast_events(node, req=None, **kwargs)[source]

Broadcasts events to a node.

Pass EventsPayload object, or see protocol.api_models.EventsPayload for available kwargs.

Return type:

None

Parameters:
cache: Cache
error_handler: ErrorHandler
fetch_bundles(node, req=None, **kwargs)[source]

Fetches bundles from a node.

Pass FetchBundles object as req or fields as kwargs.

Return type:

BundlesPayload

Parameters:
fetch_manifests(node, req=None, **kwargs)[source]

Fetches manifests from a node.

Pass FetchManifests object as req or fields as kwargs.

Return type:

ManifestsPayload

Parameters:
fetch_rids(node, req=None, **kwargs)[source]

Fetches RIDs from a node.

Pass FetchRids object as req or fields as kwargs.

Return type:

RidsPayload

Parameters:
get_base_url(node_rid)[source]

Retrieves URL of a node from its RID.

Return type:

str

Parameters:

node_rid (KoiNetNode)

identity: NodeIdentity
log: Logger
make_request(node, path, request)[source]

Makes a request to a node.

Return type:

TypeAliasType | None

Parameters:
poll_events(node, req=None, **kwargs)[source]

Polls events from a node.

Pass PollEvents object as req or fields as kwargs.

Return type:

EventsPayload

Parameters:
static report_exception(func)[source]

Logs request errors as warnings.

secure_manager: SecureManager