malcolm.modules.web.controllers

class malcolm.modules.web.controllers.HTTPServerComms(mri: Anno(name='AMri', typ=<class 'str'>, description='The Malcolm Resource Identifier for the Block produced'), port: Anno(name='APort', typ=<class 'int'>, description='TCP port number to run up under') = 8008)[source]

A class for communication between browser and server

Parameters:
  • mri (str) – The Malcolm Resource Identifier for the Block produced
  • port (int) – TCP port number to run up under
publish(published: Anno(name='APublished', typ=<class 'str'>, description='The list of currently published Controller mris')) → None[source]
Parameters:published (str) – The list of currently published Controller mris
class malcolm.modules.web.controllers.WebsocketClientComms(mri: Anno(name='AMri', typ=<class 'str'>, description='The Malcolm Resource Identifier for the Block produced'), hostname: Anno(name='AHostname', typ=<class 'str'>, description='Hostname of malcolm websocket server') = 'localhost', port: Anno(name='APort', typ=<class 'int'>, description='Port number to run up under') = 8008, connect_timeout: Anno(name='AConnectTimeout', typ=<class 'float'>, description='Time to wait for connection') = 10.0)[source]

A class for a client to communicate with the server

Parameters:
  • mri (str) – The Malcolm Resource Identifier for the Block produced
  • hostname (str) – Hostname of malcolm websocket server
  • port (int) – Port number to run up under
  • connect_timeout (float) – Time to wait for connection
recv_loop = <MagicMock name='mock.gen.coroutine()' id='139916657456848'>
on_message(message)[source]

Pass response from server to process receive queue

Parameters:message (str) – Received message
sync_proxy(mri, block)[source]

Abstract method telling the ClientComms to sync this proxy Block with its remote counterpart. Should wait until it is connected

Parameters:
  • mri (str) – The mri for the remote block
  • block (BlockModel) – The local proxy Block to keep in sync
send_put(mri, attribute_name, value)[source]

Abstract method to dispatch a Put to the server

Parameters:
  • mri (str) – The mri of the Block
  • attribute_name (str) – The name of the Attribute within the Block
  • value – The value to put
send_post(mri, method_name, **params)[source]

Abstract method to dispatch a Post to the server

Parameters:
  • mri (str) – The mri of the Block
  • method_name (str) – The name of the Method within the Block
  • params – The parameters to send
Returns:

The return results from the server