What is the recommended way to `close` a zetta instance? If I create an instance to which others link, I have to keep track of those peered connections myself, and close them all in order to successfully close the "main" instance.
Am I doing this wrong? Is there an easier way? I was looking for some exposed `close` method that would handle this on its own.
Answer by Adam Magaluk · May 17, 2016 at 06:37 PM
Hi @williamking,
We don't currently expose a `close` method on zetta. If i understand you correctly you have one cloud instance with a number of hubs connected to it and want to shutdown the cloud instance and have all the peers disconnect.
I don't think you will need to keep track of anything you just need to shutdown the api server on the cloud instance. Like:
var server = zetta().listen(3000); server.httpServer.server.close();
I've also created a Github issue here to track a possible enhancement to add a close method. https://github.com/zettajs/zetta/issues/311