{"action":"created","issue":{"url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/35","repository_url":"https://api.github.com/repos/wyyerd/pulsar-rs","labels_url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/35/comments","events_url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/35/events","html_url":"https://github.com/wyyerd/pulsar-rs/issues/35","id":477944196,"node_id":"MDU6SXNzdWU0Nzc5NDQxOTY=","number":35,"title":"Creating a Producer from a dedicated function always result in a 'Disconnected' state","user":{"login":"PierreZ","id":2698318,"node_id":"MDQ6VXNlcjI2OTgzMTg=","avatar_url":"https://avatars2.githubusercontent.com/u/2698318?v=4","gravatar_id":"","url":"https://api.github.com/users/PierreZ","html_url":"https://github.com/PierreZ","followers_url":"https://api.github.com/users/PierreZ/followers","following_url":"https://api.github.com/users/PierreZ/following{/other_user}","gists_url":"https://api.github.com/users/PierreZ/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreZ/subscriptions","organizations_url":"https://api.github.com/users/PierreZ/orgs","repos_url":"https://api.github.com/users/PierreZ/repos","events_url":"https://api.github.com/users/PierreZ/events{/privacy}","received_events_url":"https://api.github.com/users/PierreZ/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-08-07T13:54:22Z","updated_at":"2019-08-08T09:05:16Z","closed_at":"2019-08-07T19:53:20Z","author_association":"NONE","body":"Hi!\r\n\r\nI'm having trouble creating a Producer from a dedicated function. I'm always experiencing a disconnect when returning a Producer. Here's a example that is reproducing the bug:\r\n\r\n```rust\r\n    pub fn new_basic_producer() -> Result<Producer, ConnectionError> {\r\n        let runtime = tokio::runtime::Runtime::new().unwrap();\r\n        Producer::new(String::from(\"127.0.0.1:6650\"), \"topic\", None, None, None, runtime.executor()).wait()\r\n    }\r\n\r\n    #[test]\r\n    fn cloneable() {\r\n        let producer = new_basic_producer().unwrap();\r\n        let serialized = vec![240, 159, 146, 150];\r\n        let send_1 = producer.send_raw(serialized, None).wait().unwrap();\r\n    }\r\n```\r\n\r\n> thread 'tests::cloneable' panicked at 'called `Result::unwrap()` on an `Err` value: Disconnected', src/libcore/result.rs:999:5\r\n\r\nIf I put back the Producer inline, everything is working. Same issue when creating a Pool using r2d2::Pool. "},"comment":{"url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/comments/519434941","html_url":"https://github.com/wyyerd/pulsar-rs/issues/35#issuecomment-519434941","issue_url":"https://api.github.com/repos/wyyerd/pulsar-rs/issues/35","id":519434941,"node_id":"MDEyOklzc3VlQ29tbWVudDUxOTQzNDk0MQ==","user":{"login":"PierreZ","id":2698318,"node_id":"MDQ6VXNlcjI2OTgzMTg=","avatar_url":"https://avatars2.githubusercontent.com/u/2698318?v=4","gravatar_id":"","url":"https://api.github.com/users/PierreZ","html_url":"https://github.com/PierreZ","followers_url":"https://api.github.com/users/PierreZ/followers","following_url":"https://api.github.com/users/PierreZ/following{/other_user}","gists_url":"https://api.github.com/users/PierreZ/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreZ/subscriptions","organizations_url":"https://api.github.com/users/PierreZ/orgs","repos_url":"https://api.github.com/users/PierreZ/repos","events_url":"https://api.github.com/users/PierreZ/events{/privacy}","received_events_url":"https://api.github.com/users/PierreZ/received_events","type":"User","site_admin":false},"created_at":"2019-08-08T09:05:16Z","updated_at":"2019-08-08T09:05:16Z","author_association":"NONE","body":"Thank you for your reply!\r\n\r\nGood catch for the Tokio Runtime 😆 I thought that it would have been catch by the compiler, but I guess not. \r\n\r\nI will play with the pulsar::Pulsar on master, and see if I can found some issues. If not, you could make a release with an updated README. Do you need some help regarding this?"}}
{"actor":{"display_login":"PierreZ"}}