metroplex
metroplex copied to clipboard
Add ability to retrieve the sparks of a given server
This patch merges metroplex.spark
and metroplex.sparks
into metroplex.servers
. This method now accepts an additional argument which can be a single spark id or an array of spark ids. If this argument is provided the method returns only the servers for the given spark id(s), otherwise it follows the old behavior. This is the new signature:
metroplex.servers(self, sparks, fn)
The old metroplex.sparks
now returns the spark ids for the given server. It's new signature is the following:
metroplex.sparks(address, fn);
See discussion in #6.
P.S. The self
argument was not documented and not so useful IMHO. I would like to remove it if the are no objections.