notify_viewers
Tell every open viewer tab on a project to redraw.
Generated from Plexora 0.0.55View source
from plexora.api import notify_viewersnotify_viewers(project, plugin, kind, payload=None) -> intCall 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
projectstrrequiredThe project's name.
pluginstrrequiredThis plugin's own name, so a tab's listener can tell which plugin the event belongs to.
kindstrrequiredThe event's type, in whatever vocabulary this plugin uses for its own events.
payloaddictdefault NoneData to deliver with the event. Must
survive json.dumps. {} if omitted.
Returns
intHow many open tabs were told.