@@ -229,37 +229,40 @@ void Scheduler::send_impl(const ActorId<> &actor_id, const RunFuncT &run_func, c
229
229
230
230
template <ActorSendType send_type, class EventT >
231
231
void Scheduler::send_lambda (ActorRef actor_ref, EventT &&lambda) {
232
- return send_impl<send_type>(actor_ref.get (),
233
- [&](ActorInfo *actor_info) {
234
- event_context_ptr_->link_token = actor_ref.token ();
235
- lambda ();
236
- },
237
- [&]() {
238
- auto event = Event::lambda (std::forward<EventT>(lambda));
239
- event.set_link_token (actor_ref.token ());
240
- return event;
241
- });
232
+ return send_impl<send_type>(
233
+ actor_ref.get (),
234
+ [&](ActorInfo *actor_info) {
235
+ event_context_ptr_->link_token = actor_ref.token ();
236
+ lambda ();
237
+ },
238
+ [&]() {
239
+ auto event = Event::lambda (std::forward<EventT>(lambda));
240
+ event.set_link_token (actor_ref.token ());
241
+ return event;
242
+ });
242
243
}
243
244
244
245
template <ActorSendType send_type, class EventT >
245
246
void Scheduler::send_closure (ActorRef actor_ref, EventT &&closure) {
246
- return send_impl<send_type>(actor_ref.get (),
247
- [&](ActorInfo *actor_info) {
248
- event_context_ptr_->link_token = actor_ref.token ();
249
- closure.run (static_cast <typename EventT::ActorType *>(actor_info->get_actor_unsafe ()));
250
- },
251
- [&]() {
252
- auto event = Event::immediate_closure (std::forward<EventT>(closure));
253
- event.set_link_token (actor_ref.token ());
254
- return event;
255
- });
247
+ return send_impl<send_type>(
248
+ actor_ref.get (),
249
+ [&](ActorInfo *actor_info) {
250
+ event_context_ptr_->link_token = actor_ref.token ();
251
+ closure.run (static_cast <typename EventT::ActorType *>(actor_info->get_actor_unsafe ()));
252
+ },
253
+ [&]() {
254
+ auto event = Event::immediate_closure (std::forward<EventT>(closure));
255
+ event.set_link_token (actor_ref.token ());
256
+ return event;
257
+ });
256
258
}
257
259
258
260
template <ActorSendType send_type>
259
261
void Scheduler::send (ActorRef actor_ref, Event &&event) {
260
262
event.set_link_token (actor_ref.token ());
261
- return send_impl<send_type>(actor_ref.get (), [&](ActorInfo *actor_info) { do_event (actor_info, std::move (event)); },
262
- [&]() { return std::move (event); });
263
+ return send_impl<send_type>(
264
+ actor_ref.get (), [&](ActorInfo *actor_info) { do_event (actor_info, std::move (event)); },
265
+ [&]() { return std::move (event); });
263
266
}
264
267
265
268
inline void Scheduler::subscribe (PollableFd fd, PollFlags flags) {
0 commit comments