module documentation
(source)

This module is responsible for the inter-process communication (ipc) between zim instances.

It provides low level functions to:

  1. Dispatching a list of commandline arguments to a socket
  2. Listening to a socket for commandline arguments. If recieved, a callback is invoked to handle those arguments.
Function dispatch If there is an existing zim process pass along the arguments @param args: commandline arguments @raises AssertionError: when no existing zim process or connection failed
Function get_in_main_process Returns True if we are already in the main process
Function set_in_main_process Set whether we are in the main process or not
Function start_listening Start listening to socket or named pipe for new commandline calls. Also sets current process to be the main process. @param handler: the method to call when new commands are recieveds
Constant SERVER_ADDRESS Undocumented
Constant SERVER_ADDRESS_FAMILY Undocumented
Variable GObject Undocumented
Variable key Undocumented
Variable logger Undocumented
Variable runtime_dir Undocumented
Variable tmpdir Undocumented
Variable userstring Undocumented
Function _close_listener Undocumented
Function _do_accept Undocumented
Function _get_socket_for_listener Undocumented
Function _listener_thread_main Undocumented
Constant _IN_MAIN_PROCESS Undocumented
Variable _m Undocumented
def dispatch(*args): (source)
If there is an existing zim process pass along the arguments
Parameters
*argscommandline arguments
Raises
AssertionErrorwhen no existing zim process or connection failed
def get_in_main_process(): (source)
Returns True if we are already in the main process
def set_in_main_process(in_main_process): (source)
Set whether we are in the main process or not
def start_listening(handler): (source)
Start listening to socket or named pipe for new commandline calls. Also sets current process to be the main process.
Parameters
handlerthe method to call when new commands are recieveds
SERVER_ADDRESS = (source)

Undocumented

Value
(runtime_dir+'/zim-')+key
SERVER_ADDRESS_FAMILY: str = (source)

Undocumented

Value
'AF_UNIX'
GObject = (source)

Undocumented

Undocumented

logger = (source)

Undocumented

runtime_dir = (source)

Undocumented

tmpdir = (source)

Undocumented

userstring = (source)

Undocumented

def _close_listener(): (source)

Undocumented

def _do_accept(listener, handler, *a): (source)

Undocumented

def _get_socket_for_listener(listener): (source)

Undocumented

def _listener_thread_main(listener, handler): (source)

Undocumented

_IN_MAIN_PROCESS: bool = (source)

Undocumented

Value
False

Undocumented