{"action":"created","issue":{"url":"https://api.github.com/repos/bitwalker/swarm/issues/62","repository_url":"https://api.github.com/repos/bitwalker/swarm","labels_url":"https://api.github.com/repos/bitwalker/swarm/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/bitwalker/swarm/issues/62/comments","events_url":"https://api.github.com/repos/bitwalker/swarm/issues/62/events","html_url":"https://github.com/bitwalker/swarm/issues/62","id":292627155,"number":62,"title":"Using Swarm with Agents","user":{"login":"pragdave","id":10648,"avatar_url":"https://avatars0.githubusercontent.com/u/10648?v=4","gravatar_id":"","url":"https://api.github.com/users/pragdave","html_url":"https://github.com/pragdave","followers_url":"https://api.github.com/users/pragdave/followers","following_url":"https://api.github.com/users/pragdave/following{/other_user}","gists_url":"https://api.github.com/users/pragdave/gists{/gist_id}","starred_url":"https://api.github.com/users/pragdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pragdave/subscriptions","organizations_url":"https://api.github.com/users/pragdave/orgs","repos_url":"https://api.github.com/users/pragdave/repos","events_url":"https://api.github.com/users/pragdave/events{/privacy}","received_events_url":"https://api.github.com/users/pragdave/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2018-01-30T02:00:32Z","updated_at":"2018-02-01T00:40:03Z","closed_at":null,"author_association":"NONE","body":"My new course is about distributing Elixir, my way :)\r\n\r\nI'm using Swarm for registration and pubsub. I might even do some fault-tolerant stuff if I have time.\r\n\r\nI'm bumping into a minor roadblock.\r\n\r\nI have an agent-based server:\r\n\r\n~~~ elixir\r\ndefmodule Dictionary.WordList do\r\n\r\n  @me {:via, Swarm, __MODULE__ }\r\n\r\n  use Agent\r\n\r\n  def start_link(_) do\r\n    Agent.start_link(&word_list/0, name: @me)\r\n  end\r\n\r\n  def random_word() do\r\n    Agent.get(@me, &Enum.random/1)\r\n  end\r\n\r\n  ...\r\n~~~\r\n\r\nWhen another node connects to the one running this server, Swarm sends a `{:swarm, :begin_handoff}` to the Agent, which crashes it.\r\n\r\nIs there a way that I can continue to use an Agent but still register its PID via Swarm?\r\n\r\nCheers\r\n\r\n\r\nDave"},"comment":{"url":"https://api.github.com/repos/bitwalker/swarm/issues/comments/362119504","html_url":"https://github.com/bitwalker/swarm/issues/62#issuecomment-362119504","issue_url":"https://api.github.com/repos/bitwalker/swarm/issues/62","id":362119504,"user":{"login":"bitwalker","id":955793,"avatar_url":"https://avatars0.githubusercontent.com/u/955793?v=4","gravatar_id":"","url":"https://api.github.com/users/bitwalker","html_url":"https://github.com/bitwalker","followers_url":"https://api.github.com/users/bitwalker/followers","following_url":"https://api.github.com/users/bitwalker/following{/other_user}","gists_url":"https://api.github.com/users/bitwalker/gists{/gist_id}","starred_url":"https://api.github.com/users/bitwalker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitwalker/subscriptions","organizations_url":"https://api.github.com/users/bitwalker/orgs","repos_url":"https://api.github.com/users/bitwalker/repos","events_url":"https://api.github.com/users/bitwalker/events{/privacy}","received_events_url":"https://api.github.com/users/bitwalker/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T00:40:03Z","updated_at":"2018-02-01T00:40:03Z","author_association":"OWNER","body":"I can do that right away, unless you'd like to wait until I address the unhandled cast issue."}}
{"actor":{"display_login":"bitwalker"}}