3#include <boost/capy/ex/execution_context.hpp>
31 template <std::invocable<libusb_context *, std::stop_token> HandlerFn>
35 m_handler_thread = std::jthread{
46 std::shared_ptr<libusb_context> m_ctx;
47 std::optional<std::jthread> m_handler_thread;
Definition service.hpp:12
use_service
Definition context.hpp:16
Service for handling libusb events.
Definition service.hpp:21
std::stop_source stop_source()
Definition service.cpp:9
void shutdown() override
Definition service.cpp:22
void start_thread(std::shared_ptr< libusb_context > ctx, HandlerFn &&handler_fn)
Creates a default handler thread.
Definition service.hpp:32
void(*)(libusb_context *, std::stop_token) handler_fn_t
Definition service.hpp:22
~handler_service() override
Definition service.cpp:18