private static PubSubChannel MakeChannel(Guid id)
        {
            var ret = new PubSubChannel();

            ret.ownerID   = id;
            ret.onEmptied = () => OnEmptied(id);
            return(ret);
        }
Exemplo n.º 2
0
        public Shell(
            IKernel kernel,
            ICommandScheduler <JupyterRequestContext> scheduler,
            ConnectionInformation connectionInformation)
        {
            if (connectionInformation == null)
            {
                throw new ArgumentNullException(nameof(connectionInformation));
            }

            _kernel    = kernel ?? throw new ArgumentNullException(nameof(kernel));
            _scheduler = scheduler ?? throw new ArgumentNullException(nameof(scheduler));

            _shellAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.ShellPort}";
            _ioPubAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.IOPubPort}";
            _stdInAddress   = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.StdinPort}";
            _controlAddress = $"{connectionInformation.Transport}://{connectionInformation.IP}:{connectionInformation.ControlPort}";

            var signatureAlgorithm = connectionInformation.SignatureScheme.Replace("-", string.Empty).ToUpperInvariant();

            _signatureValidator = new SignatureValidator(connectionInformation.Key, signatureAlgorithm);
            _shell       = new RouterSocket();
            _ioPubSocket = new PublisherSocket();
            _stdIn       = new RouterSocket();
            _control     = new RouterSocket();

            _shellChannel = new ReplyChannel(new MessageSender(_shell, _signatureValidator));
            _ioPubChannel = new PubSubChannel(new MessageSender(_ioPubSocket, _signatureValidator));
            _stdInChannel = new StdInChannel(new MessageSender(_stdIn, _signatureValidator), new MessageReceiver(_stdIn));

            _disposables = new CompositeDisposable
            {
                _shell,
                _ioPubSocket,
                _stdIn,
                _control
            };
        }
Exemplo n.º 3
0
        private void AllocServices(JObject config)
        {
#if !NET45
			Notification = new Notification(this, config.ValueUri("notification"));
			PubSubChannel = new PubSubChannel(this, config.ValueUri("pubsub"), config.ValueUri("ws"));
#endif
			Marketplace = new Marketplace(this, marketPlaceUri);
            Queue = new Queue(this, config.ValueUri("queue"));
            Configuration = new Configuration(this, config.ValueUri("config"));
            SmsSender = new SmsSender(this, config.ValueUri("sms"));
            MailSender = new MailSender(this, config.ValueUri("email"));
            Logger = new Logging(this, config.ValueUri("logging"));
            Storage = new Storage(this, config.ValueUri("storage"));
            Files = new Files(this, config.ValueUri("files"));
            Authentication = new Authentication(marketPlaceUri.Host, config.Value<JObject>("authConfig"), this.Name);
            Service = new Service(this, config.ValueUri("service"));
			DataSource = new DataSource(this, config.ValueUri("datasource"));
        }
Exemplo n.º 4
0
 internal JupyterRequestContext(ReplyChannel serverChannel, PubSubChannel ioPubChannel, Envelope
                                request, string kernelIdentity) :
     this(new JupyterMessageSender(ioPubChannel, serverChannel, kernelIdentity, request), request, kernelIdentity)
 {
 }
 private static bool TryGetChannel(Guid target, out PubSubChannel psc) => currentChannels.TryGetValue(target, out psc);
Exemplo n.º 6
0
 public RedisPubSubServerHelper(PubSubChannel pubSubChannelName)
 {
     pubSubChannel = pubSubChannelName.ToString();
     pubSubServer  = new RedisPubSubServer(RedisHelper.PooledRedisClientManager, pubSubChannel);
     pubSubServer.Start();
 }
Exemplo n.º 7
0
 internal JupyterRequestContext(ReplyChannel serverChannel, PubSubChannel ioPubChannel, StdInChannel stdInChannel, ZeroMQMessage request, string kernelIdentity)
     : this(new JupyterMessageSender(ioPubChannel, serverChannel, stdInChannel, kernelIdentity, request), request)
 {
 }