示例#1
0
	void actor_manager::broadcast_message(module_id sender,message& msg)
	{
		assert(msg.get_type() != EMessageType::Unknown);
		msg.set_sender(sender);
		msg.set_receiver(module_id::create(0));
		for (auto& w : _workers)
		{
			w->broadcast_message(msg);
		}
	}
示例#2
0
	void actor_manager::send_message(module_id sender, module_id receiver,message& msg)
	{
		assert(msg.get_type() != EMessageType::Unknown);
		msg.set_sender(sender);
		msg.set_receiver(receiver);
		uint8_t workerID = get_workerID(receiver);
		if (workerID < _workers.size())
		{
			_workers[workerID]->dispatch_message(msg);
		}
	}
示例#3
0
文件: actor.cpp 项目: ZhHong/moon_net
	void actor::send_message( module_id receiver,message& msg)
	{
		//if send self message , add to message queue directly.
		if (receiver == get_id())
		{
			msg.set_sender(get_id());
			msg.set_receiver(get_id());
			add_message(msg);
			return;
		}
		_Imp->mgr->send_message(get_id(), receiver, msg);
	}