www.gusucode.com > trading工具箱matlab源码程序 > trading/trading/@emsx/processEvent.m
function processEvent(b,~,~) %PROCESSEVENT Sample Bloomberg EMSX event handler. % PROCESSEVENT(B) processes the EMSX event queue associated with % Bloomberg connection handle, B. % % T = timer('TimerFcn',{@b.processEvent},'Period',1,'ExecutionMode','fixedRate') % processes the EMSX event queue continually. % % See also orders, createOrderAndRoute, modifyOrder, deleteOrder, routes, routeOrder. % Copyright 2012 The MathWorks, Inc. iter = true; %process events and display messages while iter evt = b.Session.nextEvent(500); evtType = char(evt.eventType); msgIter = evt.messageIterator; switch evtType case 'TIMEOUT' iter = false; otherwise disp(char(msgIter.next)); end end