bool CapacitySubscriber::Launched(IKernel * kernel) { s_harbor = (IHarbor*)kernel->FindModule("Harbor"); OASSERT(s_harbor, "where is harbor"); s_harbor->AddNodeListener(this, "CapacitySubscriber"); REGPROTOCOL(core_proto::OVER_LOAD, CapacitySubscriber::ReadLoad); return true; }
bool Cluster::Launched(IKernel * kernel) { s_harbor = (IHarbor*)kernel->FindModule("Harbor"); OASSERT(s_harbor, "where is harbor"); s_harbor->Connect(_ip.c_str(), _port); REGPROTOCOL(node_proto::NEW_NODE, Cluster::NewNodeComming); return true; }