IPython Documentation

Table Of Contents

Previous topic

parallel.apps.winhpcjob

Next topic

parallel.client.client

This Page

parallel.client.asyncresult

Module: parallel.client.asyncresult

Inheritance diagram for IPython.parallel.client.asyncresult:

AsyncResult objects for the client

Authors:

  • MinRK

Classes

AsyncHubResult

class IPython.parallel.client.asyncresult.AsyncHubResult(client, msg_ids, fname='unknown', targets=None, tracker=None)

Bases: IPython.parallel.client.asyncresult.AsyncResult

Class to wrap pending results that must be requested from the Hub.

Note that waiting/polling on these objects requires polling the Hubover the network, so use AsyncHubResult.wait() sparingly.

__init__(client, msg_ids, fname='unknown', targets=None, tracker=None)
abort()

abort my tasks.

get(timeout=-1)

Return the result when it arrives.

If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get() inside a RemoteError.

get_dict(timeout=-1)

Get the results as a dict, keyed by engine_id.

timeout behavior is described in get().

metadata

property for accessing execution metadata.

msg_ids = None
r

result property wrapper for get(timeout=0).

ready()

Return whether the call has completed.

result

result property wrapper for get(timeout=0).

result_dict

result property as a dict.

sent

check whether my messages have been sent.

successful()

Return whether the call completed without raising an exception.

Will raise AssertionError if the result is not ready.

wait(timeout=-1)

wait for result to complete.

wait_for_send(timeout=-1)

wait for pyzmq send to complete.

This is necessary when sending arrays that you intend to edit in-place. timeout is in seconds, and will raise TimeoutError if it is reached before the send completes.

AsyncMapResult

class IPython.parallel.client.asyncresult.AsyncMapResult(client, msg_ids, mapObject, fname='')

Bases: IPython.parallel.client.asyncresult.AsyncResult

Class for representing results of non-blocking gathers.

This will properly reconstruct the gather.

__init__(client, msg_ids, mapObject, fname='')
abort()

abort my tasks.

get(timeout=-1)

Return the result when it arrives.

If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get() inside a RemoteError.

get_dict(timeout=-1)

Get the results as a dict, keyed by engine_id.

timeout behavior is described in get().

metadata

property for accessing execution metadata.

msg_ids = None
r

result property wrapper for get(timeout=0).

ready()

Return whether the call has completed.

result

result property wrapper for get(timeout=0).

result_dict

result property as a dict.

sent

check whether my messages have been sent.

successful()

Return whether the call completed without raising an exception.

Will raise AssertionError if the result is not ready.

wait(timeout=-1)

Wait until the result is available or until timeout seconds pass.

This method always returns None.

wait_for_send(timeout=-1)

wait for pyzmq send to complete.

This is necessary when sending arrays that you intend to edit in-place. timeout is in seconds, and will raise TimeoutError if it is reached before the send completes.

AsyncResult

class IPython.parallel.client.asyncresult.AsyncResult(client, msg_ids, fname='unknown', targets=None, tracker=None)

Bases: object

Class for representing results of non-blocking calls.

Provides the same interface as multiprocessing.pool.AsyncResult.

__init__(client, msg_ids, fname='unknown', targets=None, tracker=None)
abort()

abort my tasks.

get(timeout=-1)

Return the result when it arrives.

If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get() inside a RemoteError.

get_dict(timeout=-1)

Get the results as a dict, keyed by engine_id.

timeout behavior is described in get().

metadata

property for accessing execution metadata.

msg_ids = None
r

result property wrapper for get(timeout=0).

ready()

Return whether the call has completed.

result

result property wrapper for get(timeout=0).

result_dict

result property as a dict.

sent

check whether my messages have been sent.

successful()

Return whether the call completed without raising an exception.

Will raise AssertionError if the result is not ready.

wait(timeout=-1)

Wait until the result is available or until timeout seconds pass.

This method always returns None.

wait_for_send(timeout=-1)

wait for pyzmq send to complete.

This is necessary when sending arrays that you intend to edit in-place. timeout is in seconds, and will raise TimeoutError if it is reached before the send completes.

Function

IPython.parallel.client.asyncresult.check_ready(f)

Call spin() to sync state prior to calling the method.