'This allows Portal- and Server-process to call an arbitrary
function in the other process. It is intended for use by
plugin modules.
Args:
module (str or module): The module containing the
`function` to call.
function (str): The name of the function to call in
`module`.
func_args (str): Pickled args tuple for use in `function` call.
func_kwargs (str): Pickled kwargs dict for use in `function` call.'

@FunctionCall.responder
def receive_functioncall(self, module, function, func_args, func_kwargs):

    args = loads(func_args)
    kwargs = loads(func_kwargs)
    result = variable_from_module(module, function)(*args, **kwargs)
    if isinstance(result, Deferred):
        result.addCallback((lambda r: {'result': dumps(r)}))
        return result
    else:
        return {'result': dumps(result)}
