{"action":"closed","issue":{"url":"https://api.github.com/repos/daveyarwood/ezzmq/issues/2","repository_url":"https://api.github.com/repos/daveyarwood/ezzmq","labels_url":"https://api.github.com/repos/daveyarwood/ezzmq/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/daveyarwood/ezzmq/issues/2/comments","events_url":"https://api.github.com/repos/daveyarwood/ezzmq/issues/2/events","html_url":"https://github.com/daveyarwood/ezzmq/issues/2","id":183322923,"number":2,"title":"shutdown-hook! convenience fn","user":{"login":"daveyarwood","id":4909079,"avatar_url":"https://avatars.githubusercontent.com/u/4909079?v=3","gravatar_id":"","url":"https://api.github.com/users/daveyarwood","html_url":"https://github.com/daveyarwood","followers_url":"https://api.github.com/users/daveyarwood/followers","following_url":"https://api.github.com/users/daveyarwood/following{/other_user}","gists_url":"https://api.github.com/users/daveyarwood/gists{/gist_id}","starred_url":"https://api.github.com/users/daveyarwood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveyarwood/subscriptions","organizations_url":"https://api.github.com/users/daveyarwood/orgs","repos_url":"https://api.github.com/users/daveyarwood/repos","events_url":"https://api.github.com/users/daveyarwood/events{/privacy}","received_events_url":"https://api.github.com/users/daveyarwood/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-17T04:24:33Z","updated_at":"2016-10-23T18:05:17Z","closed_at":"2016-10-23T18:05:17Z","body":"For capturing Ctrl-C and doing some final actions before shutting down, e.g. in this [example code](https://github.com/alda-lang/alda/blob/474a4fb47300c12cc588afecd204c0d402566afd/server/src/alda/server.clj#L256-L260) in the Alda server.\r\n\r\nBy default, there should be a single action: destroying the context (including closing all of its sockets).\r\n\r\nThe user should be able to add additional shutdown hooks that are guaranteed to execute _before_ destroying the context.\r\n\r\nWe can do this by defining a top-level mutable list of functions and adding a shutdown hook that dereferences the list and calls each function in order, then destroys the context. Each time the user calls the `shutdown-hook!` macro, the body of the macro would be wrapped in a no-args function, which would be added to the list."}}
{"actor":{"display_login":"daveyarwood"}}