{"action":"created","issue":{"url":"https://api.github.com/repos/UltrosBot/Ultros/issues/90","labels_url":"https://api.github.com/repos/UltrosBot/Ultros/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/UltrosBot/Ultros/issues/90/comments","events_url":"https://api.github.com/repos/UltrosBot/Ultros/issues/90/events","html_url":"https://github.com/UltrosBot/Ultros/issues/90","id":121885687,"number":90,"title":"Unfuck factories","user":{"login":"gdude2002","id":204153,"avatar_url":"https://avatars.githubusercontent.com/u/204153?v=3","gravatar_id":"","url":"https://api.github.com/users/gdude2002","html_url":"https://github.com/gdude2002","followers_url":"https://api.github.com/users/gdude2002/followers","following_url":"https://api.github.com/users/gdude2002/following{/other_user}","gists_url":"https://api.github.com/users/gdude2002/gists{/gist_id}","starred_url":"https://api.github.com/users/gdude2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdude2002/subscriptions","organizations_url":"https://api.github.com/users/gdude2002/orgs","repos_url":"https://api.github.com/users/gdude2002/repos","events_url":"https://api.github.com/users/gdude2002/events{/privacy}","received_events_url":"https://api.github.com/users/gdude2002/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/UltrosBot/Ultros/labels/Blocker","name":"Blocker","color":"f7c6c7"},{"url":"https://api.github.com/repos/UltrosBot/Ultros/labels/Bug","name":"Bug","color":"eb6420"},{"url":"https://api.github.com/repos/UltrosBot/Ultros/labels/ID-10T%20error","name":"ID-10T error","color":"FFFFFF"},{"url":"https://api.github.com/repos/UltrosBot/Ultros/labels/Major","name":"Major","color":"e11d21"},{"url":"https://api.github.com/repos/UltrosBot/Ultros/labels/Protocol","name":"Protocol","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/UltrosBot/Ultros/milestones/2","html_url":"https://github.com/UltrosBot/Ultros/milestones/1.???","labels_url":"https://api.github.com/repos/UltrosBot/Ultros/milestones/2/labels","id":528841,"number":2,"title":"1.???","description":"Features and bugfixes.","creator":{"login":"gdude2002","id":204153,"avatar_url":"https://avatars.githubusercontent.com/u/204153?v=3","gravatar_id":"","url":"https://api.github.com/users/gdude2002","html_url":"https://github.com/gdude2002","followers_url":"https://api.github.com/users/gdude2002/followers","following_url":"https://api.github.com/users/gdude2002/following{/other_user}","gists_url":"https://api.github.com/users/gdude2002/gists{/gist_id}","starred_url":"https://api.github.com/users/gdude2002/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdude2002/subscriptions","organizations_url":"https://api.github.com/users/gdude2002/orgs","repos_url":"https://api.github.com/users/gdude2002/repos","events_url":"https://api.github.com/users/gdude2002/events{/privacy}","received_events_url":"https://api.github.com/users/gdude2002/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":27,"state":"open","created_at":"2014-01-07T12:48:06Z","updated_at":"2015-12-12T22:49:07Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-12-12T22:49:07Z","updated_at":"2015-12-12T23:37:15Z","closed_at":null,"body":"Here's the current path we take when we connect a protocol.\r\n\r\n* `FactoryManager` instanciates `Factory` with the name of the protocol, its config and the factory manager instance.\r\n* `FactoryManager` calls `Factory.setup()` to begin the process.\r\n* The `Factory` loads up the corresponding protocol module if it hasn't been loaded already - or reloads it if it has been.\r\n* `Factory` then instanciates the protocol with its name, config, and the instance of the `Factory`.\r\n* The protocol, in its `__init__`, calls `reactor.connect<proto>(...)`, where `<proto>` is the connection protocol, passing in the instance of the factory.\r\n* To create the connection, Twisted calls `Factory.buildProtocol(addr)`, which returns the current instance of the protocol that we've already created.\r\n\r\nTwisted, however, expects something like this:\r\n\r\n* The `Factory` is instanciated.\r\n* `reactor.connect<proto>(...)` is called, passing in the instance of the factory.\r\n* Twisted calls `Factory.buildProtocol(addr)`, which creates an instance of the protocol and returns it, allowing Twisted to connect with it.\r\n\r\nWhat would be our ideal path? Let's fix that and make it happen!\r\nAs a side effect, this ticket will result in protocols having their own factories, which is a requirement for all kinds of things."},"comment":{"url":"https://api.github.com/repos/UltrosBot/Ultros/issues/comments/164202079","html_url":"https://github.com/UltrosBot/Ultros/issues/90#issuecomment-164202079","issue_url":"https://api.github.com/repos/UltrosBot/Ultros/issues/90","id":164202079,"user":{"login":"rakiru","id":569238,"avatar_url":"https://avatars.githubusercontent.com/u/569238?v=3","gravatar_id":"","url":"https://api.github.com/users/rakiru","html_url":"https://github.com/rakiru","followers_url":"https://api.github.com/users/rakiru/followers","following_url":"https://api.github.com/users/rakiru/following{/other_user}","gists_url":"https://api.github.com/users/rakiru/gists{/gist_id}","starred_url":"https://api.github.com/users/rakiru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakiru/subscriptions","organizations_url":"https://api.github.com/users/rakiru/orgs","repos_url":"https://api.github.com/users/rakiru/repos","events_url":"https://api.github.com/users/rakiru/events{/privacy}","received_events_url":"https://api.github.com/users/rakiru/received_events","type":"User","site_admin":false},"created_at":"2015-12-12T23:37:15Z","updated_at":"2015-12-12T23:37:15Z","body":"What? It calls `buildProtocol()`..."}}