Handle to the underlying runtime.
More...
#include <rodbus.hpp>
|
| Runtime (Runtime &&other) noexcept |
| Transfer ownership of the underlying C-type to this instance and invalidate the other instance. More...
|
|
| Runtime (const RuntimeConfig &config) |
| Creates a new runtime for running the protocol stack. More...
|
|
| ~Runtime () |
| Destroy a runtime. More...
|
|
void | set_shutdown_timeout (std::chrono::steady_clock::duration timeout) |
| By default, when the runtime shuts down, it does so without a timeout and waits indefinitely for all spawned tasks to yield. More...
|
|
Handle to the underlying runtime.
◆ Runtime() [1/2]
rodbus::Runtime::Runtime |
( |
Runtime && |
other | ) |
|
|
inlinenoexcept |
Transfer ownership of the underlying C-type to this instance and invalidate the other instance.
- Note
- the moved class will now throw an exception if any method is called
- Parameters
-
other | Class from which ownership will be transfer to this instance |
◆ Runtime() [2/2]
Creates a new runtime for running the protocol stack.
- Warning
- The runtime should be kept alive for as long as it's needed and it should be released with Runtime::~Runtime()
- Parameters
-
- Exceptions
-
◆ ~Runtime()
rodbus::Runtime::~Runtime |
( |
| ) |
|
Destroy a runtime.
This method will gracefully wait for all asynchronous operation to end before returning
◆ set_shutdown_timeout()
void rodbus::Runtime::set_shutdown_timeout |
( |
std::chrono::steady_clock::duration |
timeout | ) |
|
By default, when the runtime shuts down, it does so without a timeout and waits indefinitely for all spawned tasks to yield.
Setting this value will put a maximum time bound on the eventual shutdown. Threads that have not exited within this timeout will be terminated.
- Warning
- This can leak memory. This method should only be used if the the entire application is being shut down so that memory can be cleaned up by the OS.
- Parameters
-
timeout | Maximum number of seconds to wait for the runtime to shut down |
The documentation for this class was generated from the following file: