Skip to content

Process: state that close and wait shouldn't be used along with an (exit) command #22

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

Merged
merged 1 commit into from
Dec 14, 2022
Merged
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
4 changes: 4 additions & 0 deletions src/SMTLIB/Backends/Process.hs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,16 @@ wait handle = do
waitExitCode $ process handle

-- | Terminate the process, wait for it to actually exit and cleanup its resources.
-- Don't use this if you're manually stopping the solver process by sending an
-- @(exit)@ command. Use `wait` instead.
close :: Handle -> IO ()
close handle = do
cancel $ errorReader handle
stopProcess $ process handle

-- | Create a solver process, use it to make a computation and stop it.
-- Don't use this if you're manually stopping the solver process by sending an
-- @(exit)@ command. Use @\config -> `bracket` (`new` config) `wait`@ instead.
with ::
-- | The solver process' configuration.
Config ->
Expand Down