public static LookupClient CreateNew(string host   = IQFeedDefault.Hostname, int port = IQFeedDefault.LookupPort,
                                             int timeoutMs = LookupDefault.TimeoutMs, int numberOfClients = 1, int bufferSize = LookupDefault.BufferSize)
        {
            // Common
            var requestFormatter    = new RequestFormatter();
            var lookupDispatcher    = new LookupDispatcher(host, port, bufferSize, IQFeedDefault.ProtocolVersion, numberOfClients, requestFormatter);
            var errorMessageHandler = new ErrorMessageHandler();
            var rawMessageHandler   = new RawMessageHandler(lookupDispatcher, errorMessageHandler, timeoutMs);

            // Historical
            var historicalDataRequestFormatter = new HistoricalRequestFormatter();
            var historicalRawFace = new HistoricalRawFacade(historicalDataRequestFormatter, rawMessageHandler);
            var historicalFacade  = new HistoricalFacade(
                historicalDataRequestFormatter,
                lookupDispatcher,
                errorMessageHandler,
                new HistoricalMessageHandler(),
                historicalRawFace,
                timeoutMs
                );

            // News
            var newsFacade = new NewsFacade();

            // Symbol
            var symbolFacade = new SymbolFacade(new MarketSymbolDownloader(), new MarketSymbolReader(), new ExpiredOptionDownloader(), new ExpiredOptionReader());

            // Chains
            var chainsFacade = new ChainsFacade(new ChainsRequestFormatter(), new ChainsMessageHandler(), lookupDispatcher, errorMessageHandler, timeoutMs);

            return(new LookupClient(lookupDispatcher, historicalFacade, newsFacade, symbolFacade, chainsFacade));
        }
Ejemplo n.º 2
0
 public HistoricalRawFacade(
     HistoricalRequestFormatter historicalRequestFormatter,
     RawMessageHandler rawMessageHandler)
 {
     _rawMessageHandler          = rawMessageHandler;
     _historicalRequestFormatter = historicalRequestFormatter;
 }
Ejemplo n.º 3
0
        public void register_raw_message_handler(string type, RawMessageHandler handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            _cloudService.RegisterMessageHandler(type, p => handler(PythonConvert.ToPythonDictionary(p)));
        }
Ejemplo n.º 4
0
 public ApolloResult Register(TalkerCommand command, RawMessageHandler handler)
 {
     if (command != null && handler != null)
     {
         if (ApolloMessageManager.Instance.Exist(command))
         {
         }
         ApolloMessage apolloMessage = new ApolloMessage(command);
         apolloMessage.RawMessageHandler = handler;
         ApolloMessageManager.Instance.Add(apolloMessage);
         return(ApolloResult.Success);
     }
     return(ApolloResult.InvalidArgument);
 }
Ejemplo n.º 5
0
        public ApolloResult Register(TalkerCommand command, RawMessageHandler handler)
        {
            if ((command == null) || (handler == null))
            {
                return(ApolloResult.InvalidArgument);
            }
            if (ApolloMessageManager.Instance.Exist(command))
            {
            }
            ApolloMessage message = new ApolloMessage(command)
            {
                RawMessageHandler = handler
            };

            ApolloMessageManager.Instance.Add(message);
            return(ApolloResult.Success);
        }
Ejemplo n.º 6
0
 public override void SetSentRawMessageHandler(RawMessageHandler handler, object parameter)
 {
     linkLayer.SetSentRawMessageHandler(handler, parameter);
 }
Ejemplo n.º 7
0
 public void SetSentRawMessageHandler(RawMessageHandler handler, object parameter)
 {
     sentRawMessageHandler          = handler;
     sentRawMessageHandlerParameter = parameter;
 }
Ejemplo n.º 8
0
 public void SetReceivedRawMessageHandler(RawMessageHandler handler, object parameter)
 {
     receivedRawMessageHandler          = handler;
     receivedRawMessageHandlerParameter = parameter;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Sets the sent message handler for sent messages.
 /// </summary>
 /// <param name="handler">Handler/delegate that will be invoked when a message is sent<</param>
 /// <param name="parameter">will be passed to the delegate</param>
 public abstract void SetSentRawMessageHandler(RawMessageHandler handler, object parameter);
Ejemplo n.º 10
0
 /// <summary>
 /// Sets the raw message handler for received messages
 /// </summary>
 /// <param name="handler">Handler/delegate that will be invoked when a message is received</param>
 /// <param name="parameter">will be passed to the delegate</param>
 public abstract void SetReceivedRawMessageHandler(RawMessageHandler handler, object parameter);
Ejemplo n.º 11
0
 public void SetReceivedRawMessageHandler(RawMessageHandler handler, object parameter)
 {
     linkLayer.SetReceivedRawMessageHandler(handler, parameter);
 }
Ejemplo n.º 12
0
 public ApolloResult Register(RawMessageHandler handler)
 {
     return(this.Register(new TalkerCommand(TalkerCommand.CommandDomain.App, TalkerCommand.CommandValueType.Raw), handler));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Sets the raw message handler. This is a callback to intercept raw messages received.
 /// </summary>
 /// <param name="handler">Handler.</param>
 /// <param name="parameter">Parameter.</param>
 public void SetRawMessageHandler(RawMessageHandler handler, object parameter)
 {
     rawMessageHandler          = handler;
     rawMessageHandlerParameter = parameter;
 }