#NEWLINE# def invoke( self , method , parameters = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , timeout = None , auto_retry_count = None , **kwargs ) : #NEWLINE# #INDENT# 'Invoke a ``method`` to be run on a remote worker process with the given ``parameters``. If specified, ``callback`` will be\n       invoked with any response from the remote worker. By default the worker will timeout or retry based on the settings of the\n       current ``WorkerConnection`` but ``timeout`` and ``auto_retry_count`` can be used for invocation specific behavior.\n\n       ``invoke()`` returns a future that may be used to yield the result.\n\n       Alternatively, you can invoke methods with ``WorkerConnection.<module>.<method>(*args, **kwargs)``\n       where ``"<module>.<method>"`` will be passed as the ``method`` argument to ``invoke()``.\n    ' #NEWLINE# headers = { #NEWLINE# #INDENT# 'Content-Type' : self . mime , #NEWLINE# #UNINDENT# } #NEWLINE# body = self . compress ( self . dumps ( { #NEWLINE# #INDENT# 'method' : method , #NEWLINE# 'parameters' : parameters , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# timeout = ( timeout if ( timeout is not None ) else self . timeout ) #NEWLINE# auto_retry_count = ( auto_retry_count if ( auto_retry_count is not None ) else self . auto_retry_count ) #NEWLINE# future = Future ( ) #NEWLINE# request = _Request ( headers , body , timeout , auto_retry_count , future , self . handle_response ) #NEWLINE# self . __active_requests [ request . request_id ] = request #NEWLINE# request . run_request ( self . __next_endpoint ( ) ) #NEWLINE# if ( auto_retry_count and timeout ) : #NEWLINE# #INDENT# IOLoop . current ( ) . add_timeout ( ( time ( ) + timeout ) , self . handle_timeout , request ) #NEWLINE# #UNINDENT# return future