pyslurmutils.client.job_io.tcp_io.Future#

class pyslurmutils.client.job_io.tcp_io.Future(job_id, future, stop, client=None)[source]#

Bases: Future

Parameters:
  • job_id (int) –

  • future (Future) –

  • stop (Event) –

cancel()[source]#

Cancel the future if possible. The SLURM job is not affected.

Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed.

Return type:

bool

cancel_job()[source]#

Cancel the SLURM job

Return type:

None

cancelled()[source]#

Return True if the future was cancelled.

Return type:

bool

cleanup_job()[source]#

Cleanup job artifacts

Return type:

None

property client#
done()[source]#

Return True if the future was cancelled or finished executing.

Return type:

bool

exception(timeout=None)[source]#

Waits for the result indefinitely by default.

Raises:

TimeoutError: the job is not finished CancelledError: the job IO was cancelled

Parameters:

timeout (Optional[Number]) –

Return type:

Optional[Exception]

job_status()[source]#
Return type:

None

result(timeout=None)[source]#

Waits for the result indefinitely by default.

Raises:

TimeoutError: the job is not finished CancelledError: the job IO was cancelled Exception: the exception raised by the job

Parameters:

timeout (Optional[Number]) –

Return type:

Any

running()[source]#

Return True if the future is currently executing.

Return type:

bool

shutdown()[source]#
Return type:

None

wait(timeout=None)[source]#
Parameters:

timeout (Optional[Number]) –

Return type:

bool