2#ifndef _KURLYK_STARTUP_RUNTIME_HPP_INCLUDED
3#define _KURLYK_STARTUP_RUNTIME_HPP_INCLUDED
13 inline void init(
const bool use_async =
true) {
15# if KURLYK_HTTP_SUPPORT
18# if KURLYK_WEBSOCKET_SUPPORT
21 instance.start(use_async);
static HttpRequestManager & get_instance()
Get the singleton instance of HttpRequestManager.
static WebSocketManager & get_instance()
Get the singleton instance of WebSocketManager.
void stop()
Stops the worker thread, ensuring all tasks are completed.
static NetworkWorker & get_instance()
Get the singleton instance of NetworkWorker.
void process()
Processes all queued tasks and active HTTP and WebSocket requests.
void add_error_handler(ErrorHandler handler)
Registers a callback for handling network errors.
void shutdown()
Shuts down the worker, clearing all active requests and pending tasks.
std::function< void(const std::exception &, const char *, const char *, int, const char *)> ErrorHandler
Primary namespace for the Kurlyk library, encompassing initialization, request management,...
void init(const bool use_async=true)
Initializes the Kurlyk library, setting up necessary managers and the network worker.
void shutdown()
Shuts down all network operations, resetting the state of the network worker and clearing pending req...
void add_error_handler(::kurlyk::core::NetworkWorker::ErrorHandler handler)
Registers a global error handler for the network worker.
void deinit()
Deinitializes the Kurlyk library, stopping the network worker and releasing resources.
void process()
Processes pending requests (used in synchronous mode).