Esempio n. 1
0
  static void my_actor(self_t self, aid_t base)
  {
    std::size_t loop_num = 10;
    yield_t yield = self.get_yield();
    timer_t tmr(self.get_cache_pool()->get_context().get_io_service());

    for (std::size_t i=0; i<loop_num; ++i)
    {
      send(self, base, atom("echo"));
      recv(self, atom("echo"));

      tmr.expires_from_now(boost::chrono::milliseconds(1));
      tmr.async_wait(yield);
    }
  }