Plexora

notify_viewers

Tell every open viewer tab on a project to redraw.

Generated from Plexora 0.0.55View source
from plexora.api import notify_viewers
notify_viewers(project, plugin, kind, payload=None) -> int

Call this from a plugin route that changed a project's state some other way than the tab that is asking for it -- an import finishing, a batch operation -- so every other open tab on that project picks up the change too, instead of showing stale state until its next reload.

Parameters

projectstrrequired

The project's name.

pluginstrrequired

This plugin's own name, so a tab's listener can tell which plugin the event belongs to.

kindstrrequired

The event's type, in whatever vocabulary this plugin uses for its own events.

payloaddictdefault None

Data to deliver with the event. Must survive json.dumps. {} if omitted.

Returns

int

How many open tabs were told.