-
Notifications
You must be signed in to change notification settings - Fork 11
API Design Notes
Shahbaz Chaudhary edited this page Sep 11, 2015
·
2 revisions
======[Test Framework]==========================================================
var testStack = stack(...);
var outgoing = stack();
var session = new FIXSession("FIX.4.2", "SENDER", "TARGET");
session.interceptOutgoing(msg => outgoing.push(msg));
for msg in testStack:
if msg is I:
session.processIncoming(msg);
else msg is E:
out = outgoing.pop()
assert msg === out
======[Client API]==============================================================
var fixc = FIX.createClient(version, sender, target);
fixc.on('msg', x=> console.log(msg));
fixc.send(msg, status, msg => console.log("msg sent status:"+status+" for message: "+msg));
fixc.monitor(msg=>console.log("monitored message:"+msg));
fixc.manager().resetSeqNo("compid", oldnum, newnum);
======[Server API]==============================================================
var fixs = FIX.createServer(version, sender);
fixs.on('msg', (cmopid, x)=> console.log(msg));
fixs.send(target, msg, status, msg => console.log("msg sent status:"+status+" for message: "+msg));
fixs.monitor(target, msg=>console.log("monitored message:"+msg));