gd_node.protocols.http package

Submodules

gd_node.protocols.http.http_message module

class gd_node.protocols.http.http_message.HttpMessage(app=None, req=None)

Bases: object

Messsage

gd_node.protocols.http.http_route module

class gd_node.protocols.http.http_route.HttpRoute(_node_name: str, _port_name: str, _topic: str, _message: str, _callback: str, _params: dict, _update: bool, **_ignore)

Bases: object

Http endpoints

Parameters:
  • _node_name – Name of the node instance

  • _port_name – Name of the port

  • _topic – Not used

  • _message – Url rule

  • _callback – Name of the callback to be executed

async run_callback(request: Request) Response

http handler

send(msg: Any)

prepare reply

gd_node.protocols.http.movai_widget module

class gd_node.protocols.http.movai_widget.MovaiWidget(name, uid, _type='widgets')

Bases: object

get_defaults()
get_general()
is_supported(node, user=None)
user_settings(user)

gd_node.protocols.http.web_socket module

class gd_node.protocols.http.web_socket.WebSocketSub(_node_name: str, _port_name: str, _topic: str, _message: str, _callback: str, _params: dict, _update: bool, **_ignore)

Bases: object

Websocket subscriber

broadcast(msg: Any, channel: str)

interface to call broadcast coroutine

run_callback(msg: Any)

execute callback

send(msg: Any, channel: str)

prepare reply

async websocket_handler(request: Request) WebSocketResponse

handle websocket connections

Module contents

Copyright (C) Mov.ai - All Rights Reserved Unauthorized copying of this file, via any medium is strictly prohibited Proprietary and confidential

Developers: - Manuel Silva (manuel.silva@mov.ai) - 2020 - Tiago Paulino (tiago@mov.ai) - 2020

Maintainers: - Tiago Teixeira (tiago.teixeira@mov.ai) - 2020

Module that implements the Asynchronous Http Server

class gd_node.protocols.http.CreateServer(_node_name: str, _hostname: str, _port: int, *, test=False)

Bases: object

Class that creates a aiohttp server with support for http and websockets

Parameters:
  • _hostname – Name of the server host

  • _port – Port of the server

async run()

Keep the server running

start()
class gd_node.protocols.http.HTTP

Bases: object

Holder for app

app: Application = None