Plugin system integration

The integration of the plugin system into the server is handled here. All other documentation regarding the plugin system is to be found rixaplugin

class dashboard.apps.DashboardConfig(app_name, app_module)

This class is the configuration class for the dashboard app.

default_auto_field
name
ready()

Override this method in subclasses to run code when Django starts.

async dashboard.apps.await_code_execution(code, api_obj)

This function is used to execute code and then display the result in the chat.

async dashboard.apps.await_future_execution(future, api_obj, is_chat=False)

This function is used to await the result of a future and then display it in the chat or the web interface. Required as plugin execution is always async and the result must be awaited before it can be displayed.

Parameters:
  • future

  • api_obj – api_obj of user (i.e. where to send the result)

  • is_chat – Origin of future

Returns:

dashboard.apps.patch_users()

When creating users using the command line, the RixaUser object is not created. This function patches this. :return:

dashboard.apps.patched_set_event_loop(loop)

This functions hooks into djangos main event loop to start the plugin system. It also starts a thread to collect statistics. :param loop: :return:

async dashboard.apps.plugin_interface()

This function listens to the channel layer for messages of type “plugin_interface” and then executes the corresponding plugin function or code.

It is the “heart” of the plugin system.