You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So right now things aren't as great as they could be in DNSChain-code land, but we've got radical improvements lined up (#80, #75).
Because we're not using a events/notifcations (the pub/sub model), we've got code like this:
shutdown:-> [@nmc, @dns, @http].forEach (s) ->s?.shutdown?()
But that's kinda lame because it "central management" and requires DNSChain to be updated for every single new server that's added. Instead, as per #80, we can implement in blockchain.coffee (the template for all supported blockchains) a notification listener for ShutdownNotification, and have the individual servers clean up for themselves.
Then DNSChain's shutdown: method would simply post that notification, wait a bit (asynchronously) and then process.exit.
NodeJS already has an event system that we can use to implement this.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6958929-add-a-pub-sub-notification-mechanism-and-make-all-classes-listen?utm_campaign=plugin&utm_content=tracker%2F528702&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F528702&utm_medium=issues&utm_source=github).
The text was updated successfully, but these errors were encountered:
So right now things aren't as great as they could be in DNSChain-code land, but we've got radical improvements lined up (#80, #75).
Because we're not using a events/notifcations (the pub/sub model), we've got code like this:
But that's kinda lame because it "central management" and requires DNSChain to be updated for every single new server that's added. Instead, as per #80, we can implement in
blockchain.coffee
(the template for all supported blockchains) a notification listener forShutdownNotification
, and have the individual servers clean up for themselves.Then DNSChain's
shutdown:
method would simply post that notification, wait a bit (asynchronously) and thenprocess.exit
.NodeJS already has an event system that we can use to implement this.
Edit: Note, this part from
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6958929-add-a-pub-sub-notification-mechanism-and-make-all-classes-listen?utm_campaign=plugin&utm_content=tracker%2F528702&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F528702&utm_medium=issues&utm_source=github).app.coffee
might need a small update.The text was updated successfully, but these errors were encountered: