michaelwittig / node-q

Q interfacing with Node.js
MIT License
52 stars 14 forks source link

make upd function configurable #38

Open markmcdowell opened 6 years ago

markmcdowell commented 6 years ago

Hello, great library it works well!

Unfortunately as is typical with kdb, we have a custom upd function this is actually .u.upd

This means I can't subscribe with out hacking the following line:

if (err === undefined && Array.isArray(o) && o[0] === "upd") 
{
   events.EventEmitter.prototype.emit.apply(self, o);
} 

to

if (err === undefined && Array.isArray(o) && o[0] === ".u.upd") 
{
   o[0] = "upd";
   events.EventEmitter.prototype.emit.apply(self, o);
} 

Any chance we could change to pass in the function name to subscribe to?

michaelwittig commented 6 years ago

Hi @markmcdowell sounds reasonable. Are you familiar with opening a Pull Request? You fork the project, make your change in a separate branch and then open a PR. Besides your code changes we need to make the "upd" / ".u.upd" string configurable (e.g. on the Connection), some tests, update to the docs.