Dispatcher

class dispatcher

Running Jobs

inline void run()
inline void stop_running()
inline void terminate_now()
inline bool terminating()

Managing Queue

template<template<typename> typename kind_of, event_c event_t>
inline void queue_back(kind_of<event_t> ke)
template<template<typename> typename kind_of, event_c event_t>
inline void queue_front(kind_of<event_t> ke)

Public Functions

inline dispatcher(runner &r)
class job

Public Functions

inline job(std::size_t j_id, int s_id, std::size_t h, std::any ke)
job(const job&) = delete
job(job&&) = default
job &operator=(const job&) = delete
job &operator=(job &&j) = default
template<template<typename> typename kind_of, event_c event_t>
inline kind_of<event_t> event()
template<template<typename> typename kind_of, event_c event_t>
inline received<event_t> event()
inline std::size_t id() const
inline int socket_id() const
inline std::size_t spec_hash() const
inline decltype(ctx.out()) format_to(fmt::format_context &ctx) const
inline void set_id(std::size_t id)
struct hf_registry

Public Functions

inline hf_registry(runner &r)
template<template<typename> typename kind_of, ev::event_c event_t, typename class_t>
inline void on(void (class_t::* mem_fn)(hf_arg<kind_of, event_t>), class_t *self)
class enqueuer

Public Functions

inline enqueuer(dispatcher &d, runner &r)
template<internal_event_c event_t>
inline void queue_fire(event_t ev)
template<template<typename> typename kind_of, network_event_c event_t, network_event_c event2_t>
inline void queue_fire(event_t ev, ev::metadata<kind_of, event2_t> md)
template<network_event_c event_t, net::tool_c tool_t>
inline void queue_fire(event_t ev, const int s_id, tool_t &t, const net::pipe &p)
template<network_event_c event_t, net::tool_c tool_t>
inline void queue_sent(event_t ev, int s_id, tool_t &t, net::pipe p)
template<net::tool_c tool_t>
inline void queue_received(nngxx::msg m, int s_id, tool_t &t, net::pipe p)
struct runner

Public Functions

inline runner(hf_registry &hfs)
inline std::size_t next_job_id()
inline void start_thread(std::size_t spec_hash, std::packaged_task<void(std::stop_token, job)> task, job j)
inline auto count_threads()
inline void stop_all_threads()
inline bool can_exec(int s_id, std::size_t spec_hash)
inline void exec(job j)
template<template<typename> typename kind_of, event_c event_t>
inline void exec(kind_of<event_t> ke)
inline void add_pipe(const net::pipe &p)
inline void remove_pipe(const net::pipe &p)

stop all running and remove all pending jobs for pipe p

inline void associate_job_to_pipe(const int j_id, const int p_id)
inline void stop_thread(const int j_id)
struct serialize

Public Static Functions

template<event_c event_t>
static inline nngxx::msg to_network(event_t &ev)
template<event_c event_t>
static inline event_t to_event(const nngxx::msg &m)
template<typename callable_t>
struct hf_traits
template<typename mem_fn_t, template<typename> typename kind_of = hf_traits<mem_fn_t>::template kind_type, typename event_t = hf_traits<mem_fn_t>::event_type, typename class_t = hf_traits<mem_fn_t>::class_type>
handler_f<kind_of, event_t> pars::ev::make_hf(mem_fn_t &mem_fn, class_t *self)
using pars::ev::job_handler_f = std::function<void(job)>
template<template<typename> typename kind_of, event_c event_t>
using pars::ev::handler_f = std::move_only_function<void(hf_arg<kind_of, event_t>)>
template<template<typename> typename kind_of, event_c event_t>
using pars::ev::hf_arg = kind_of<event_t>