ReactivePlusPlus
ReactiveX implementation for C++20
Toggle main menu visibility
Loading...
Searching...
No Matches
immediate.hpp
1
// ReactivePlusPlus library
2
//
3
// Copyright Aleksey Loginov 2023 - present.
4
// Distributed under the Boost Software License, Version 1.0.
5
// (See accompanying file LICENSE_1_0.txt or copy at
6
// https://www.boost.org/LICENSE_1_0.txt)
7
//
8
// Project home: https://github.com/AlexInLog/ReactivePlusPlus
9
//
10
11
#pragma once
12
13
#include <rpp/schedulers/fwd.hpp>
14
15
#include <rpp/disposables/disposable_wrapper.hpp>
16
#include <rpp/schedulers/details/utils.hpp>
17
#include <rpp/schedulers/details/worker.hpp>
18
#include <rpp/utils/functors.hpp>
19
20
namespace
rpp::schedulers
21
{
64
class
immediate
final
65
{
66
public
:
67
class
worker_strategy
68
{
69
public
:
70
template
<
rpp::schedulers::constraint::schedulable_handler
Handler,
typename
... Args,
constraint::schedulable_fn
<Handler, Args...> Fn>
71
static
void
defer_for(duration duration, Fn&& fn, Handler&& handler, Args&&... args)
72
{
73
details::immediate_scheduling_while_condition<worker_strategy>(duration,
rpp::utils::return_true
{}, std::forward<Fn>(fn), std::forward<Handler>(handler), std::forward<Args>(args)...);
74
}
75
76
static
rpp::schedulers::time_point now() {
return
rpp::schedulers::clock_type::now(); }
77
};
78
79
static
rpp::schedulers::worker<worker_strategy>
create_worker()
80
{
81
return
rpp::schedulers::worker<worker_strategy>
{};
82
}
83
};
84
}
// namespace rpp::schedulers
rpp::schedulers::immediate::worker_strategy
Definition
immediate.hpp:68
rpp::schedulers::immediate
immediately calls provided schedulable or waits for time_point (in the caller-thread)
Definition
immediate.hpp:65
rpp::schedulers::worker
Definition
worker.hpp:23
rpp::schedulers::constraint::schedulable_fn
Definition
fwd.hpp:110
rpp::schedulers::constraint::schedulable_handler
Definition
fwd.hpp:113
rpp::utils::return_true
Definition
functors.hpp:68
src
rpp
rpp
schedulers
immediate.hpp
Generated by
1.17.0