public static ConcurrentQueue<output> _queue = new ConcurrentQueue<output>();// dict store all surrounding Info public static void requestFlow(output x) { lock (reqFlow.locker0) { try { _queue.Enqueue(x); DepthOfBkHndlr dobkUnderhndlr = new MktSrvcAPI.DepthOfBkHndlr((_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk) => respFlow.dobkUnderhndlr(_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk)); Conn._dobkUnderClient.depofbkhndlr = dobkUnderhndlr; Conn._dobkUnderClient.Subscribe(new InstrInfo { sym = x.under, type = InstrInfo.EType.EQUITY, }); //Console.WriteLine("request: " + x.under + x.callput); } catch (Exception e) { Console.WriteLine(e.Message); } //Console.WriteLine("000 "+((ConcurrentQueue<output>)_Dict[0][6]).Count); } }
//public static void requestFlow(output x) //{ // try // { // _queue.Enqueue(x); // DepthOfBkHndlr depofbkhndlr0 = new MktSrvcAPI.DepthOfBkHndlr((_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk) => respFlow2.depofbkhndlr(_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk)); // Conn._DepthofBkClient.depofbkhndlr = depofbkhndlr0; // Conn._DepthofBkClient.Subscribe(x.instr); // } // catch (Exception ex) // { // Console.WriteLine(ex.Message); // } //} public static void requestFlow(output x1, output x2) { try { _queue.Enqueue(x1); _queue.Enqueue(x2); DepthOfBkHndlr depofbkhndlr0 = new MktSrvcAPI.DepthOfBkHndlr((_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk) => respFlow2.depofbkhndlr(_instr, _ts, _partid, _mod, _numbid, _numask, _bidexch, _askexch, _bidbk, _askbk)); Conn._DepthofBkClient.depofbkhndlr = depofbkhndlr0; Conn._DepthofBkClient.Subscribe(x1.instr); Conn._DepthofBkClient.Subscribe(x2.instr); } catch (Exception ex) { Console.WriteLine(ex.Message); } }