/// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="callback">The callback for updates.</param>
        public ControlClientAsUpdateSource( ITopicUpdaterUpdateCallback callback )
        {
            updateCallback = callback;

            session = Diffusion.Sessions.Principal( "control" ).Password( "password" )
                .Open( "ws://diffusion.example.com;80" );

            topicControl = session.GetTopicControlFeature();
            updateControl = session.GetTopicUpdateControlFeature();
        }
Example #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="callback">The callback for updates.</param>
        public ControlClientAsUpdateSource(ITopicUpdaterUpdateCallback callback)
        {
            updateCallback = callback;

            session = Diffusion.Sessions.Principal("control").Password("password")
                      .Open("ws://diffusion.example.com;80");

            topicControl  = session.GetTopicControlFeature();
            updateControl = session.GetTopicUpdateControlFeature();
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public ControlClientUpdatingTopic()
        {
            session = Diffusion.Sessions.Principal("control").Password("password")
                      .Open("ws://diffusion.example.com:80");

            topicControl  = session.GetTopicControlFeature();
            updateControl = session.GetTopicUpdateControlFeature();

            // Create a single-value topic.
            topicControl.AddTopicFromValue(Topic, TopicType.SINGLE_VALUE, new TopicControlAddCallbackDefault());
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public ControlClientUpdatingTopic()
        {
            session = Diffusion.Sessions.Principal( "control" ).Password( "password" )
                .Open( "ws://diffusion.example.com:80" );

            topicControl = session.GetTopicControlFeature();
            updateControl = session.GetTopicUpdateControlFeature();

            // Create a single-value topic.
            topicControl.AddTopicFromValue( Topic, TopicType.SINGLE_VALUE, new TopicControlAddCallbackDefault() );
        }
        public TopicManager(ISession session, DataGenerators.ICarControlsDataGenerator carControlsDataGenerator, DataGenerators.ICarStateDataGenerator carStateDataGenerator, RefreshIntervalManager refreshIntervalManager, Metrics metrics)
        {
            this.carControlsDataGenerator = carControlsDataGenerator;
            this.carStateDataGenerator = carStateDataGenerator;
            this.refreshIntervalManager = refreshIntervalManager;
            this.metrics = metrics;

            topics = session.GetTopicsFeature();
            topicControl = session.GetTopicControlFeature();
            topicUpdateControl = session.GetTopicUpdateControlFeature();

            topicPathsPendingAddition = new List<string>();

            // The first thing we need to do is kick of an asynchronous request to see
            // whether our root topic path already exists.
            var topicDetailsHandler = new Handlers.TopicDetailsHandler();
            topicDetailsHandler.Success += topicDetailsHandler_Success;
            topics.GetTopicDetails(rootTopicPath, TopicDetailsLevel.BASIC, topicDetailsHandler);
        }
        public TopicManager(ISession session, DataGenerators.ICarControlsDataGenerator carControlsDataGenerator, DataGenerators.ICarStateDataGenerator carStateDataGenerator, RefreshIntervalManager refreshIntervalManager, Metrics metrics)
        {
            this.carControlsDataGenerator = carControlsDataGenerator;
            this.carStateDataGenerator    = carStateDataGenerator;
            this.refreshIntervalManager   = refreshIntervalManager;
            this.metrics = metrics;

            topics             = session.GetTopicsFeature();
            topicControl       = session.GetTopicControlFeature();
            topicUpdateControl = session.GetTopicUpdateControlFeature();

            topicPathsPendingAddition = new List <string>();

            // The first thing we need to do is kick of an asynchronous request to see
            // whether our root topic path already exists.
            var topicDetailsHandler = new Handlers.TopicDetailsHandler();

            topicDetailsHandler.Success += topicDetailsHandler_Success;
            topics.GetTopicDetails(rootTopicPath, TopicDetailsLevel.BASIC, topicDetailsHandler);
        }
 public AddCallback( ITopicUpdateControl updater, UpdateSource source )
 {
     updateControl = updater;
     updateSource = source;
 }
Example #8
0
 public AddCallback(ITopicUpdateControl updater, UpdateSource source)
 {
     updateControl = updater;
     updateSource  = source;
 }