3. Nodes

Turberfield IPC can build for you a network node object, which takes your parcelled messages and delivers them to others listening via the distributed IPC framework (DIF).

3.1. Tokens

You’ll need a DIF token to use the framework. For now, the function turberfield.ipc.fsdb.token() is the source of these.

3.2. Down and up

Turberfield’s interface with the network point of attachment (POA) is via a pair of asyncio queues. The down queue takes your messages into the network, and the up queue is where messages arrive from the network.

3.3. Mechanisms and policies

Inspired by John Day’s Patterns in Network Architecture, the design of Turberfield IPC decouples network mechanisms and the policies which control them. A node can adopt the policies it wishes. However, there is only a minimal implementation (over UDP) at the moment, and so only one way of configuring a node.

3.4. Creating a network node

The module provides a convenience function to build a network node with the currently available routing functionality.

turberfield.ipc.node.create_udp_node(loop, token, down, up, types)[source]
Parameters:
  • loop – An asyncio event loop.
  • token – A DIF token.
  • down – An asyncio queue which takes messages down to the network POA.
  • up – An asyncio queue which bring up messages from the network POA.
  • types – An optional dictionary of types mapped by their fully qualified names.
Return type:

An asyncio Protocol instance.