wotpy.protocols.http.handlers.action

Request handler for Action interactions.

Classes

ActionInvokeHandler(application, request, …) Handler for Action invocation requests.
PendingInvocationHandler(application, …) Handler to check the status of pending action invocations.
class wotpy.protocols.http.handlers.action.ActionInvokeHandler(application, request, **kwargs)

Bases: tornado.web.RequestHandler

Handler for Action invocation requests.

initialize(http_server)

Hook for subclass initialization. Called for each request.

A dictionary passed as the third argument of a url spec will be supplied as keyword arguments to initialize().

Example:

class ProfileHandler(RequestHandler):
    def initialize(self, database):
        self.database = database

    def get(self, username):
        ...

app = Application([
    (r'/user/(.*)', ProfileHandler, dict(database=database)),
    ])
post(thing_name, name)

Invokes the action and returns the invocation result.

class wotpy.protocols.http.handlers.action.PendingInvocationHandler(application, request, **kwargs)

Bases: tornado.web.RequestHandler

Handler to check the status of pending action invocations.

get(invocation_id)

Checks and returns the status of the Future that represents an action invocation.

initialize(http_server)

Hook for subclass initialization. Called for each request.

A dictionary passed as the third argument of a url spec will be supplied as keyword arguments to initialize().

Example:

class ProfileHandler(RequestHandler):
    def initialize(self, database):
        self.database = database

    def get(self, username):
        ...

app = Application([
    (r'/user/(.*)', ProfileHandler, dict(database=database)),
    ])