c# - I need some explain on Rx behavior -
when use reactive extensions (rx) linq filter happen under hood?
is this,
var move = observable.fromeventpattern<mouseeventargs>(frm, "mousemove"); iobservable<system.drawing.point> points = evt in move select evt.eventargs.location; var overfirstbisector = pos in points pos.x == pos.y select pos; var movesub = overfirstbisector.subscribe(pos => console.writeline("mouse @ " + pos));
more efficient this?
private void mousemove(object sender, eventargs args) { if (args.location.x == args.locationy) console.writeline("mouse @ " + args.location); }
i dont talk filtering logic events behavior of methods. in rx event raised same way of regular event warapper or there somthing special under hood?
in case, there's no algorithmic performance benefit using rx query on typical event handler - in fact, rx query may marginally slower typical event handler. "under hood" rx query doing same thing typical event handler, in cleaner way.
Comments
Post a Comment