Example #1
0
        protected void CreateConnection()
        {
            Logger.Info($"CreateConnection: {null}");
            var connection = new Connection(Model.Name, Model.Host, Model.Port);

            if (NatsService.Create(connection, out var msg))
            {
                Connections.Insert(0, connection);
            }

            Status = msg;
            InvokeAsync(StateHasChanged);
        }
Example #2
0
        protected void CreateSession()
        {
            Logger.Info($"{nameof(CreateSession)}: {Model}");
            var session = new Session(Model.Name)
            {
                Checked = false,
            };

            NatsService.Create(session, out _);
            NatsService.Save();
            Sessions.SetData(NatsService.Configuration.Sessions);
            OnSelectedItemChanged(session);
        }
Example #3
0
        protected void CreateSubscription()
        {
            Logger.Info($"{nameof(CreateSubscription)}: {Model}");
            var natsSubscription = new NatsSubscription(Model.Subject)
            {
                Checked    = false,
                Subscribed = false
            };

            if (NatsService.Create(natsSubscription, out _))
            {
                Subscriptions.Insert(0, natsSubscription);
            }
            Subscribe(natsSubscription);
        }