A client serves as a gateway for submitting jobs and querying information about a running HyperQueue server. :param server_dir: Path to a server directory of a running HyperQueue server. :param python_env: Python environment which configures Python tasks created by
(
self,
server_dir: Optional[GenericPath] = None,
python_env: Optional[PythonEnv] = None,
)
| 53 | |
| 54 | class Client: |
| 55 | def __init__( |
| 56 | self, |
| 57 | server_dir: Optional[GenericPath] = None, |
| 58 | python_env: Optional[PythonEnv] = None, |
| 59 | ): |
| 60 | """ |
| 61 | A client serves as a gateway for submitting jobs and querying information about a running |
| 62 | HyperQueue server. |
| 63 | |
| 64 | :param server_dir: Path to a server directory of a running HyperQueue server. |
| 65 | :param python_env: Python environment which configures Python tasks created by |
| 66 | [`function`](`hyperqueue.job.Job.function`). |
| 67 | """ |
| 68 | server_dir = str(server_dir) if server_dir else None |
| 69 | self.connection = ClientConnection(server_dir) |
| 70 | if python_env is None: |
| 71 | python_env = PythonEnv() |
| 72 | self.python_env = python_env |
| 73 | |
| 74 | def submit(self, job: Job) -> SubmittedJob: |
| 75 | """ |
nothing calls this directly
no test coverage detected