Skip to content

Commit

Permalink
Fix interface
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Sep 29, 2023
1 parent ab66f6d commit 85e8736
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions spinnman/spalloc/spalloc_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ def create_transceiver(self) -> Transceiver:
"""

@abstractmethod
def wait_for_state_change(self, old_state: SpallocState) -> SpallocState:
def wait_for_state_change(self, old_state: SpallocState,
timeout: int = None) -> SpallocState:
"""
Wait until the allocation is not in the given old state.
:param SpallocState old_state:
The state that we are looking to change out of.
:param timeout:
The time to wait, or None to wait forever
:type timeout: int or None
:return: The state that the allocation is now in.
.. note::
Expand All @@ -146,10 +150,15 @@ def wait_for_state_change(self, old_state: SpallocState) -> SpallocState:
"""

@abstractmethod
def wait_until_ready(self):
def wait_until_ready(self, timeout: int = None, n_retries: int = None):
"""
Wait until the allocation is in the ``READY`` state.
:param timeout: The timeout or None to wait forever
:type timeout: int or None
:param n_retries:
The number of times to retry, or None to retry forever
:type n_retries: int or None
:raises Exception: If the allocation is destroyed
"""

Expand Down

0 comments on commit 85e8736

Please sign in to comment.