Пример #1
0
        public Channel(string endpoint, string name, string description)
        {
            Endpoint    = endpoint;
            Name        = name;
            Description = description;

            Warehouse = new Warehouse();

            TimeMachine = new TimeMachine(Warehouse, endpoint);

            Services = new HashSet <BroadcastService>();

            Observer = new ProtoModelObserver();
            Warehouse.RegisterObserver(Observer);

            TimeMachine.StartRecording();
        }
        public BroadcastService(Channel channel, object uglyLock, bool strictServer)
        {
            LiveWarehouse = channel.Warehouse;
            TimeMachine   = channel.TimeMachine;

            _strictServer = strictServer;
            _channel      = channel;

            _protoModelObserver = channel.Observer;

            _toProtobuf   = new ToProtobuf();
            _fromProtobuf = new FromProtobuf(LiveWarehouse);
            _lock         = uglyLock;

            CurrentWarehouse           = null;
            _currentProtoModelObserver = new ProtoModelObserver();

            channel.RegisterService(this);
        }