Extending out

Running your own host

You may want to integrate IMMP into a larger project, which likely means using your own entrypoint rather than python -m immp. For this, you will need to create your own Host instance and set it up appropriately.

Hosts have a set of methods for adding features:

  • Host.add_plug()

  • Host.add_channel()

  • Host.add_hook()

Each takes an existing corresponding instance, which you’ll need to construct yourself according to your requirements. You may alternatively want to read a config file in the same way the built-in entry point does, in which case: create and attach a RunnerHook, then call RunnerHook.load() to populate the host with the defined plugs and hooks.

Interactive shell

The Shell hook provides an asynchronous back-door console, which allows you to connect (with netcat, telnet etc.) to a Python interpreter running alongside the host.

This can be used to introspect the host as well as any running plugs or hooks, add or remove parts, change their config, or manually insert messages.