Return back formatting.
GitOrigin-RevId: bf312eacf255e8bae70a60d31d5a4f62063814af
This commit is contained in:
parent
f471746973
commit
eb24c3baa4
@ -229,40 +229,37 @@ void Scheduler::send_impl(const ActorId<> &actor_id, const RunFuncT &run_func, c
|
||||
|
||||
template <ActorSendType send_type, class EventT>
|
||||
void Scheduler::send_lambda(ActorRef actor_ref, EventT &&lambda) {
|
||||
return send_impl<send_type>(
|
||||
actor_ref.get(),
|
||||
[&](ActorInfo *actor_info) {
|
||||
event_context_ptr_->link_token = actor_ref.token();
|
||||
lambda();
|
||||
},
|
||||
[&]() {
|
||||
auto event = Event::lambda(std::forward<EventT>(lambda));
|
||||
event.set_link_token(actor_ref.token());
|
||||
return std::move(event);
|
||||
});
|
||||
return send_impl<send_type>(actor_ref.get(),
|
||||
[&](ActorInfo *actor_info) {
|
||||
event_context_ptr_->link_token = actor_ref.token();
|
||||
lambda();
|
||||
},
|
||||
[&]() {
|
||||
auto event = Event::lambda(std::forward<EventT>(lambda));
|
||||
event.set_link_token(actor_ref.token());
|
||||
return std::move(event);
|
||||
});
|
||||
}
|
||||
|
||||
template <ActorSendType send_type, class EventT>
|
||||
void Scheduler::send_closure(ActorRef actor_ref, EventT &&closure) {
|
||||
return send_impl<send_type>(
|
||||
actor_ref.get(),
|
||||
[&](ActorInfo *actor_info) {
|
||||
event_context_ptr_->link_token = actor_ref.token();
|
||||
closure.run(static_cast<typename EventT::ActorType *>(actor_info->get_actor_unsafe()));
|
||||
},
|
||||
[&]() {
|
||||
auto event = Event::immediate_closure(std::forward<EventT>(closure));
|
||||
event.set_link_token(actor_ref.token());
|
||||
return std::move(event);
|
||||
});
|
||||
return send_impl<send_type>(actor_ref.get(),
|
||||
[&](ActorInfo *actor_info) {
|
||||
event_context_ptr_->link_token = actor_ref.token();
|
||||
closure.run(static_cast<typename EventT::ActorType *>(actor_info->get_actor_unsafe()));
|
||||
},
|
||||
[&]() {
|
||||
auto event = Event::immediate_closure(std::forward<EventT>(closure));
|
||||
event.set_link_token(actor_ref.token());
|
||||
return std::move(event);
|
||||
});
|
||||
}
|
||||
|
||||
template <ActorSendType send_type>
|
||||
void Scheduler::send(ActorRef actor_ref, Event &&event) {
|
||||
event.set_link_token(actor_ref.token());
|
||||
return send_impl<send_type>(
|
||||
actor_ref.get(), [&](ActorInfo *actor_info) { do_event(actor_info, std::move(event)); },
|
||||
[&]() { return std::move(event); });
|
||||
return send_impl<send_type>(actor_ref.get(), [&](ActorInfo *actor_info) { do_event(actor_info, std::move(event)); },
|
||||
[&]() { return std::move(event); });
|
||||
}
|
||||
|
||||
inline void Scheduler::subscribe(PollableFd fd, PollFlags flags) {
|
||||
|
Loading…
Reference in New Issue
Block a user