[rpcinterface:x] Section Settings

Adding rpcinterface:x settings in the configuration file is onlyuseful for people who wish to extend supervisor with additional custombehavior.

In the sample config file, there is a section which is named[rpcinterface:supervisor]. By default it looks like thefollowing.

  1. [rpcinterface:supervisor]
  2. supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

The [rpcinterface:supervisor] section must remain in theconfiguration for the standard setup of supervisor to work properly.If you don’t want supervisor to do anything it doesn’t already do outof the box, this is all you need to know about this type of section.

However, if you wish to add rpc interface namespaces in order tocustomize supervisor, you may add additional [rpcinterface:foo]sections, where “foo” represents the namespace of the interface (fromthe web root), and the value named bysupervisor.rpcinterface_factory is a factory callable which shouldhave a function signature that accepts a single positional argumentsupervisord and as many keyword arguments as required to performconfiguration. Any extra key/value pairs defined within the[rpcinterface:x] section will be passed as keyword arguments tothe factory.

Here’s an example of a factory function, created in theinit.py file of the Python package my.package.

  1. from my.package.rpcinterface import AnotherRPCInterface
  2.  
  3. def make_another_rpcinterface(supervisord, **config):
  4. retries = int(config.get('retries', 0))
  5. another_rpc_interface = AnotherRPCInterface(supervisord, retries)
  6. return another_rpc_interface

And a section in the config file meant to configure it.

  1. [rpcinterface:another]
  2. supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
  3. retries = 1

[rpcinterface:x] Section Values

supervisor.rpcinterface_factory

pkg_resources “entry point” dotted name to your RPC interface’sfactory function.

Default: N/A

Required: No.

Introduced: 3.0

[rpcinterface:x] Section Example

  1. [rpcinterface:another]
  2. supervisor.rpcinterface_factory = my.package:make_another_rpcinterface
  3. retries = 1