コード例 #1
0
        public void Start()
        {
            if (_started)
            {
                throw new Exception("Core is already started");
            }

            // TODO: Move this to the master node, where we can either query the live status of the
            // current node or query the last-known status of the requested node.
            // Also, be clear whether we are querying by NodeId or NetworkNodeId (the former is
            // more likely)
            //_subscriptions.Listen<NodeStatusRequest, NodeStatus>(l => l.OnDefaultChannel().Invoke(r => GetStatus(r.NodeId)));

            Modules.AddMissingModules(this);
            CoreModule.Start();
            Modules.StartAll();
            Modules.WarnOnMissingModules(Log);

            _started = true;
            MessageBus.Publish(CoreEvent.ChannelInitialized, new CoreEvent());

            // TODO: Report version? Other details?
            Log.LogInformation("Core initialized Id={0}", NodeId);
        }