API Documentation


class paragram.Process

The base class of all paragram Process objects.

Member :


If a process terminates with an error, this attribute is set to the exception instance. In all other cases, it is None


Typically, wait() is a better choice.


Send a message to this process


Send an exit message to this process


Wait for this process to finish

class paragram.process.base_process.LocalProcess

Code running inside a process can use these methods on the process object, in addition to the public methods provided by paragram.Process

Member :


Used to set a new receiver, with either of two syntaxes:

>>> process.receive[message] = handler


>>> @process.receive(message)
>>> def handler(...):
...     # ...

For more information, see Handling Messages

spawn(target, name=None, link_to=None, kind=None, args=(), kwargs={})

Spawn a new process. target is called with the newly-created process as its first argument, followed by args and kwargs (if present).

target is responsible for setting up any receivers on the process and sending any initial messages. After that, the process will run until terminated.

  • target – The callable that will be used to init this process.
  • name – Name of this process, for use in logging, etc.
  • link_to – used by spawn_link() to link the newly-created process to an existing process.
  • kind – The class of this process. Should be either OSProcess or ThreadProcess.
  • args – extra arguments to pass to target
  • kwargs – extra keyword arguments to pass to target

This function calls spawn() with all provided arguments, setting link_to to self.


A paragram process implemented as a separate operating system process.


A paragram process implemented as a new thread in the current OS process.

See also: Handling Messages



Matches any object


Matches any remaining objects in a tuple or list


A fake paragram process representing the main thread of control. This should not be directly referenced by anything but the main thread - if another process needs to talk to the main process, it should be sent a reference to this object in a message rather than accessing it directly.

Table Of Contents

Previous topic

Pattern Matching

This Page