Marco reference

class marcopolo.marco.marco.Marco[source]

Initializes all the data structures and sockets, setting timeouts and other socket options

marco(max_nodes=None, exclude=[], timeout=None, params={}, retries=0, group='')[source]

Sends a marco message to all nodes, which reply with a Polo message. Upon receiving all responses (those arriving before the timeout), a collection of the response information is returned.

  • exclude (list) – List of nodes to be excluded from the returned ValueError.
  • timeout (int) – If set, overrides the default timeout value.
  • retries (int) – If set to a value greater than 0, retries the retries times if the first attempt is unsuccessful
  • max_nodes (int) – Maximum number of nodes to be returned. If set to None, no limit is applied.

A list of all responding nodes.

request_for(service, node=None, max_nodes=None, exclude=[], params={}, timeout=None, group='')[source]

Request all nodes offering a certain service or the details for one single node

  • service (string) – Name of the requested service
  • node (string) – Address or name of the desired node

an array with all the available nodes

services(addr, timeout=None, retries=0)[source]

Searches for the services available in a certain node identified by its address

  • addr (string) – Address of the node
  • port (int) – UDP port of the Polo instance. If not given, the default is the port in the conffile

An array with all detected nodes

class marcopolo.marco.marcobinding.MarcoBinding[source]

Twisted class for an asynchronous socket server