wotpy.protocols.http.handlers.event

Request handler for Event interactions.

Classes

EventObserverHandler(application, request, ...)

Handler for Event subscription requests.

class wotpy.protocols.http.handlers.event.EventObserverHandler(application: Application, request: HTTPServerRequest, **kwargs: Any)

Bases: RequestHandler

Handler for Event subscription requests.

async get(thing_name, name)

Subscribes to the given Event and waits for the next emission (HTTP long-polling pattern). Returns the event emission payload and destroys the subscription afterwards.

initialize(http_server)
on_finish()

Destroys the subscription to the observable when the request finishes.