{"action":"created","issue":{"url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/350","labels_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/350/labels{/name}","comments_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/350/comments","events_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/350/events","html_url":"https://github.com/CausalityLtd/ponyc/issues/350","id":115495674,"number":350,"title":"Erlang-style monitoring","user":{"login":"sylvanc","id":2785007,"avatar_url":"https://avatars.githubusercontent.com/u/2785007?v=3","gravatar_id":"","url":"https://api.github.com/users/sylvanc","html_url":"https://github.com/sylvanc","followers_url":"https://api.github.com/users/sylvanc/followers","following_url":"https://api.github.com/users/sylvanc/following{/other_user}","gists_url":"https://api.github.com/users/sylvanc/gists{/gist_id}","starred_url":"https://api.github.com/users/sylvanc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylvanc/subscriptions","organizations_url":"https://api.github.com/users/sylvanc/orgs","repos_url":"https://api.github.com/users/sylvanc/repos","events_url":"https://api.github.com/users/sylvanc/events{/privacy}","received_events_url":"https://api.github.com/users/sylvanc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CausalityLtd/ponyc/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/CausalityLtd/ponyc/labels/hard","name":"hard","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-06T12:25:51Z","updated_at":"2015-11-06T12:44:44Z","closed_at":null,"body":"When an actor is no longer reachable, either because it has been garbage collected or (in the future, on a distributed runtime) a node has crashed taking all the actors on it with it, some other (still running) actors may want to be informed.\r\n\r\nI think the best thing to do is copy from the best, and provide an Erlang-style monitoring facility. It's on my to-do list. I'll use this issue to post updates as/when they happen.\r\n\r\n@darach and I put together a preliminary notion of how it will work. Since actors are GC'd, notification can't use the actor's memory address as a unique identifier, so when an actor is first \"monitored\" it will generate a unique non-memory actor identifier. On the distributed runtime, that ID will need to be node-aware so that it doesn't conflict with IDs generated by other nodes (probably using a prefix rather than a more expensive PRNG).\r\n\r\nThen, when an actor is GC'd, monitors will receive a notification based on the generated ID rather than the actors (old) address. Similarly, in the distributed runtime, when a node dies, all other nodes with references to actors on the (now dead) node will generate notifications for the set of (now dead) actors.\r\n"},"comment":{"url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/comments/154400282","html_url":"https://github.com/CausalityLtd/ponyc/issues/350#issuecomment-154400282","issue_url":"https://api.github.com/repos/CausalityLtd/ponyc/issues/350","id":154400282,"user":{"login":"andreaTP","id":5792097,"avatar_url":"https://avatars.githubusercontent.com/u/5792097?v=3","gravatar_id":"","url":"https://api.github.com/users/andreaTP","html_url":"https://github.com/andreaTP","followers_url":"https://api.github.com/users/andreaTP/followers","following_url":"https://api.github.com/users/andreaTP/following{/other_user}","gists_url":"https://api.github.com/users/andreaTP/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaTP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaTP/subscriptions","organizations_url":"https://api.github.com/users/andreaTP/orgs","repos_url":"https://api.github.com/users/andreaTP/repos","events_url":"https://api.github.com/users/andreaTP/events{/privacy}","received_events_url":"https://api.github.com/users/andreaTP/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T12:44:44Z","updated_at":"2015-11-06T12:44:44Z","body":"Are you planning any kind of hierarchical model for actors?"}}