void deliver(response_promise& rp, message& x) {
   CAF_LOG_DEBUG("respond via response_promise");
   // suppress empty messages for asynchronous messages
   if (x.empty() && rp.async())
     return;
   rp.deliver(std::move(x));
 }
예제 #2
0
void stream_manager::deliver_handshake(response_promise& rp, stream_slot slot,
                                       message handshake) {
  CAF_LOG_TRACE(CAF_ARG(rp) << CAF_ARG(slot) << CAF_ARG(handshake));
  CAF_ASSERT(rp.pending());
  CAF_ASSERT(slot != invalid_stream_slot);
  ++pending_handshakes_;
  auto next = rp.next();
  rp.deliver(open_stream_msg{slot, std::move(handshake), self_->ctrl(), next,
                             priority_});
}
예제 #3
0
파일: command.hpp 프로젝트: dezelin/opencl
 void handle_results() {
   auto& map_fun = actor_facade_->map_results_;
   auto msg = map_fun ? apply_args(map_fun,
                                   detail::get_indices(result_buffers_),
                                   result_buffers_)
                      : message_from_results{}(result_buffers_);
   handle_.deliver(std::move(msg));
 }
예제 #4
0
stream_slot
stream_manager::add_unchecked_outbound_path_impl(response_promise& rp,
                                                 message handshake) {
  CAF_LOG_TRACE(CAF_ARG(rp) << CAF_ARG(handshake));
  CAF_ASSERT(out().terminal() == false);
  if (!rp.pending()) {
    CAF_LOG_WARNING("add_outbound_path called with next == nullptr");
    rp.deliver(sec::no_downstream_stages_defined);
    return invalid_stream_slot;
  }
  auto slot = self_->assign_next_pending_slot_to(this);
  auto path = out().add_path(slot, rp.next());
  CAF_IGNORE_UNUSED(path);
  CAF_ASSERT(path != nullptr);
  // Build pipeline by forwarding handshake along the path.
  deliver_handshake(rp, slot, std::move(handshake));
  generate_messages();
  return slot;
}
 void deliver(response_promise& rp, error& x) {
   CAF_LOG_DEBUG("report error back to requesting actor");
   rp.deliver(std::move(x));
 }
예제 #6
0
파일: command.hpp 프로젝트: ajac/libcppa
 void handle_results () {
     m_handle.deliver(m_actor_facade->m_map_result(m_result));
 }