-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spawn/ProcessHandle: add completion callback
This allows callers to not only wait for completion, but also receive error details. This will replace lots of weird (protocol/socket) error messages (because the child has disappeared and has reset a socket connection to the caller) with spawner error messages.
- Loading branch information
1 parent
99cc2fd
commit 77ef53f
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// Copyright CM4all GmbH | ||
// author: Max Kellermann <[email protected]> | ||
|
||
#pragma once | ||
|
||
#include <exception> | ||
|
||
/** | ||
* This interface gets notified when spawning a child process | ||
* completes. Pass a reference to an instance to | ||
* ChildProcessHandle::SetCompletionHandler(). | ||
*/ | ||
class SpawnCompletionHandler { | ||
public: | ||
virtual void OnSpawnSuccess() noexcept = 0; | ||
virtual void OnSpawnError(std::exception_ptr error) noexcept = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters