Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default timeout to CancelSlaves #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions python/mujinplanningclient/planningclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,24 @@ def SendConfig(self, command, slaverequestid=None, timeout=None, fireandforget=N
return response['output']

def TerminateSlaves(self, slaverequestids, timeout=None, fireandforget=None, checkpreempt=True):
"""terminate slaves with specific slaverequestids
""" Terminate slaves with specific slaverequestids

Args:
slaverequestids (list[str]): list of slaverequestid corresponding to slaves to be terminated
timeout (float, optional): Time in seconds after which the command is assumed to have failed.
fireandforget (bool, optional): Whether we should return immediately after sending the command. If True, return value is None.
checkpreempt (bool, optional): If a preempt function should be checked during execution.
"""
return self.SendConfig({'command':'TerminateSlaves', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt)

def CancelSlaves(self, slaverequestids, timeout=None, fireandforget=None, checkpreempt=True):
"""cancel the current commands on the slaves with specific slaverequestids
def CancelSlaves(self, slaverequestids, timeout=10, fireandforget=None, checkpreempt=True):
""" Cancel the current commands on the slaves with specific slaverequestids

Args:
slaverequestids (list[str]): list of slaverequestid corresponding to slaves to be cancelled
timeout (float, optional): Time in seconds after which the command is assumed to have failed.
fireandforget (bool, optional): Whether we should return immediately after sending the command. If True, return value is None.
checkpreempt (bool, optional): If a preempt function should be checked during execution.
"""
return self.SendConfig({'command':'cancel', 'slaverequestids':slaverequestids}, timeout=timeout, fireandforget=fireandforget, checkpreempt=checkpreempt)

Expand Down