# Submit And Wait Set `dispatch="submit"` to submit solve work without waiting for completion. {func}`solve ` returns a {term}`submission` handle. Call the submission's {meth}`wait() ` method to collect the solve result. Use this page when the solve must continue while your code performs other operations. For one immediate result, omit `dispatch="submit"` and use the normal solve call. ```python import jcmsuite with jcmsuite.daemon.handler() as daemon: submission = jcmsuite.solve( "project.jcmp", dispatch="submit", ) # Other operations result = submission.wait() ``` Alternatively, call {meth}`wait() ` on the {class}`DaemonHandler ` with the submission. ```python import jcmsuite with jcmsuite.daemon.handler() as daemon: submission = jcmsuite.solve( "project.jcmp", dispatch="submit", ) # Other operations result = daemon.wait(submission) ``` The wait operation collects the final result and attaches the daemon execution log to the {class}`SolveResult `. ## Submit A Batch Pass {term}`batched project keys` to submit several solve entries: ```python with jcmsuite.daemon.handler() as daemon: submission = jcmsuite.solve( "project.jcmp", keys=[{"radius": 0.3}, {"radius": 0.4}, {"radius": 0.5}, {"radius": 0.6}], dispatch="submit", ) # Other operations batch = submission.wait() ``` {func}`solve ` returns a {class}`BatchSolveSubmission ` in input order. Its wait operation returns a {class}`BatchSolveResult `. {class}`BatchSolveSubmission ` supports slicing. A slice selects a subset of the original submission, and its wait operation returns a {class}`BatchSolveResult ` for that subset. You can collect one subset and then another subset later. ```python with jcmsuite.daemon.handler() as daemon: submission = jcmsuite.solve( "project.jcmp", keys=[{"radius": 0.3}, {"radius": 0.4}, {"radius": 0.5}, {"radius": 0.6}], dispatch="submit", ) first_half = submission[:2] first_batch = first_half.wait() # Other operations second_half = submission[2:] second_batch = second_half.wait() ``` {term}`Ordered project bundles ` and batches of ordered project bundles also support `dispatch="submit"`. See [Ordered project bundles](../../core/solve/bundles.md) for the input shapes. ## Control Collection Use these {meth}`wait() ` options to collect submitted work. For a batch submission, the returned {class}`BatchSolveResult ` contains the entries collected under the selected policy. | Option | Values | Effect | | ------------ | ------------------------ | ----------------------------------------------------------------------- | | `break_when` | `"all"` or `"any"` | Wait for all requested submissions, or return after the first requested submission finishes. | | `timeout` | Seconds or `None` | Stop waiting after the specified duration. `None` means no timeout. The return policy can provide a partial result. | | `on_timeout` | `"raise"` or `"return"` | Raise on timeout, or return the entries available before the time limit. | | `on_error` | `"raise"` or `"collect"` | Raise on a failed batch entry, or retain it as structured {class}`BatchSolveFailure ` information. | | `progress` | `True` or `False` | Show a progress indicator while collecting a batch. | | `progress_label` | String or `None` | Specify the text for the progress indicator. | For example: ```python batch = submission.wait( break_when="any", timeout=60, on_timeout="return", on_error="collect", progress=True, ) ``` If `on_timeout="raise"` or `on_error="raise"` is selected, the wait operation raises instead of returning the partial or failed batch result. If `on_timeout="return"` is selected, inspect the returned entries before you use their results. ## Inspect Or Close Submissions Use {meth}`daemon.jobs.info() ` to request information for all tracked submissions. Pass `job_id` values to select a subset. Use {meth}`daemon.jobs.kill() ` to close tracked submissions and release local tracking state. Pass `job_id` values to close selected submissions. Omit the argument to close all tracked submissions: ```python closed_ids = daemon.jobs.kill([submission.job_id]) ``` submission behavior applies to [Batched Solves](../../core/solve/batched.md) and [Ordered project bundles](../../core/solve/bundles.md). See [Async Execution](../async.md) for async behavior across direct solves and daemon submission. See the [Submit And Collect Daemon Work tutorial](../../tutorials/execution_runtime/daemon/03_submit_wait.md) for a runnable partial-collection workflow.