{"action":"created","issue":{"url":"https://api.github.com/repos/lpereira/lwan/issues/120","labels_url":"https://api.github.com/repos/lpereira/lwan/issues/120/labels{/name}","comments_url":"https://api.github.com/repos/lpereira/lwan/issues/120/comments","events_url":"https://api.github.com/repos/lpereira/lwan/issues/120/events","html_url":"https://github.com/lpereira/lwan/pull/120","id":115763767,"number":120,"title":"Move switcher to thread struct to allow coro injection from outside","user":{"login":"malthe","id":26405,"avatar_url":"https://avatars.githubusercontent.com/u/26405?v=3","gravatar_id":"","url":"https://api.github.com/users/malthe","html_url":"https://github.com/malthe","followers_url":"https://api.github.com/users/malthe/followers","following_url":"https://api.github.com/users/malthe/following{/other_user}","gists_url":"https://api.github.com/users/malthe/gists{/gist_id}","starred_url":"https://api.github.com/users/malthe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malthe/subscriptions","organizations_url":"https://api.github.com/users/malthe/orgs","repos_url":"https://api.github.com/users/malthe/repos","events_url":"https://api.github.com/users/malthe/events{/privacy}","received_events_url":"https://api.github.com/users/malthe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-08T21:49:20Z","updated_at":"2015-11-26T08:52:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lpereira/lwan/pulls/120","html_url":"https://github.com/lpereira/lwan/pull/120","diff_url":"https://github.com/lpereira/lwan/pull/120.diff","patch_url":"https://github.com/lpereira/lwan/pull/120.patch"},"body":"I use this to co-opt the event loop with a redis connection per thread.\r\n\r\nIn my setup I connect to redis, clone the file descriptor and set up a reader and writer ``coro_t`` that both run as ``lwan_connection_t`` connections.\r\n\r\nTo inject the coros into the connection pool I use the same shared ``switcher`` (per thread)."},"comment":{"url":"https://api.github.com/repos/lpereira/lwan/issues/comments/159850485","html_url":"https://github.com/lpereira/lwan/pull/120#issuecomment-159850485","issue_url":"https://api.github.com/repos/lpereira/lwan/issues/120","id":159850485,"user":{"login":"malthe","id":26405,"avatar_url":"https://avatars.githubusercontent.com/u/26405?v=3","gravatar_id":"","url":"https://api.github.com/users/malthe","html_url":"https://github.com/malthe","followers_url":"https://api.github.com/users/malthe/followers","following_url":"https://api.github.com/users/malthe/following{/other_user}","gists_url":"https://api.github.com/users/malthe/gists{/gist_id}","starred_url":"https://api.github.com/users/malthe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malthe/subscriptions","organizations_url":"https://api.github.com/users/malthe/orgs","repos_url":"https://api.github.com/users/malthe/repos","events_url":"https://api.github.com/users/malthe/events{/privacy}","received_events_url":"https://api.github.com/users/malthe/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T08:52:25Z","updated_at":"2015-11-26T08:52:25Z","body":"@dyu no it's not in a working state yet – it's unrealistic to implement it correctly before we a per-thread command queue is implemented, \"including things like 'add file descriptor to epoll', 'make coroutine resumable', etc.\".\r\n\r\nThat will make it much easier to co-opt lwan's io-loop with a redis per-thread worker."}}