51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Msg.h"
|
|
#include "Actor.h"
|
|
|
|
#include <memory>
|
|
#include <tuple>
|
|
|
|
namespace bts {
|
|
|
|
class IDomain;
|
|
class TopicDirectory;
|
|
|
|
class Executor {
|
|
public:
|
|
Executor(Address my_address,IDomain &,TopicDirectory &td);
|
|
~Executor();
|
|
void bootstrap(ActorPtr &&with_actor);
|
|
|
|
void on_poll();
|
|
void on_request(Request const&r) ;
|
|
void on_reply(Reply const&r) ;
|
|
|
|
void on_subscription(Subscription const&s);
|
|
void on_unsubscription(Unsubscription const&s);
|
|
void on_notification(Notification const& notification);
|
|
|
|
void send_request(Address from, Address to,MethodID,ReplyHandler const&,MethodArgCopier const&);
|
|
void subscribe(ActorID subscriber, TopicID);
|
|
void unsubscribe(ActorID subscriber, TopicID);
|
|
void publish(ActorID, TopicID, NotificationCopier const&);
|
|
|
|
void spawn (Address from, ExecutorID to, ActorPtr &&, OnSpawn const&on_reply);
|
|
void kill (Address from, Address to, OnKill const&on_reply);
|
|
Address address() const ;
|
|
|
|
private:
|
|
struct LifeCycleManager;
|
|
struct TopicRecord;
|
|
struct PImpl;
|
|
std::unique_ptr<PImpl> me;
|
|
|
|
std::tuple<RequestError,Address> on_spawn_actor(ActorPtr &&actor);
|
|
RequestError on_kill_actor(ActorID aid);
|
|
bool local_address(Address a) const;
|
|
};
|
|
|
|
|
|
}
|
|
|