{"action":"created","issue":{"url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/115","repository_url":"https://api.github.com/repos/spicavigo/kafka-rust","labels_url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/115/comments","events_url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/115/events","html_url":"https://github.com/spicavigo/kafka-rust/issues/115","id":165717725,"number":115,"title":"client/consumer/producer: time api","user":{"login":"xitep","id":8274125,"avatar_url":"https://avatars.githubusercontent.com/u/8274125?v=3","gravatar_id":"","url":"https://api.github.com/users/xitep","html_url":"https://github.com/xitep","followers_url":"https://api.github.com/users/xitep/followers","following_url":"https://api.github.com/users/xitep/following{/other_user}","gists_url":"https://api.github.com/users/xitep/gists{/gist_id}","starred_url":"https://api.github.com/users/xitep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitep/subscriptions","organizations_url":"https://api.github.com/users/xitep/orgs","repos_url":"https://api.github.com/users/xitep/repos","events_url":"https://api.github.com/users/xitep/events{/privacy}","received_events_url":"https://api.github.com/users/xitep/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spicavigo/kafka-rust/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-15T06:03:44Z","updated_at":"2016-08-01T06:26:53Z","closed_at":null,"body":"Rework the public API such that it accepts `std::time::Duration` in places where it currently expects the user to provide a duration in milliseconds. This will be less prone to unit mismatches and errors by mistake. So far the places identified are:\r\n\r\n* `kafka::producer::Builder::with_ack_timeout`\r\n* `kafka::client::KafkaClient::produce_messages` (ack_timeout parameter)\r\n* `kafka::client::KafkaClient::set_retry_backoff_time` and `kafka::client::KafkaClient::retry_backoff_time`\r\n* `kafka::client::KafkaClient::fetch_max_wait_time` and `kafka::client::KafkaClient::set_fetch_max_wait_time`\r\n* `kafka::consumer::Builder::with_fetch_max_wait_time`\r\n\r\nThe following are `const` and cannot currently be represented as a `Duration`; merely rename them to clarify:\r\n\r\n* `kafka::producer::DEFAULT_ACK_TIMEOUT` -> `DEFAULT_ACK_TIMEOUT_MILLIS`\r\n* `kafka::client::DEFAULT_RETRY_BACKOFF_TIME` -> `DEFAULT_RETRY_BACKOFF_TIME_MILLIS`\r\n* `kafka::client::DEFAULT_FETCH_MAX_WAIT_TIME` -> `DEFAULT_FETCH_MAX_WAIT_TIME_MILLIS`\r\n\r\nInternally, we might persist the values as milliseconds if necessary to avoid repeated unnecessary conversions from the duration representation. However, the conversion of a `Duration` to an `i32` (as often required by the kafka the protocol) might fail; we shall introduce an `InvalidDuration` error  (ideally with some information about which duration was found to be invalid) and fail if the conversion is not safely possible: For `Producer` and `Consumer` we would fail upon the call to their `Builder::create()` method. In `KafkaClient` we'll be failing lazily in `fetch_message` and `produce_messages`.\r\n\r\nThis will be a breaking change of course.\r\n\r\nAll new, future public API aspects around a duration shall be represented with the information being exposed as a `std::time::Duration`."},"comment":{"url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/comments/236499127","html_url":"https://github.com/spicavigo/kafka-rust/issues/115#issuecomment-236499127","issue_url":"https://api.github.com/repos/spicavigo/kafka-rust/issues/115","id":236499127,"user":{"login":"xitep","id":8274125,"avatar_url":"https://avatars.githubusercontent.com/u/8274125?v=3","gravatar_id":"","url":"https://api.github.com/users/xitep","html_url":"https://github.com/xitep","followers_url":"https://api.github.com/users/xitep/followers","following_url":"https://api.github.com/users/xitep/following{/other_user}","gists_url":"https://api.github.com/users/xitep/gists{/gist_id}","starred_url":"https://api.github.com/users/xitep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitep/subscriptions","organizations_url":"https://api.github.com/users/xitep/orgs","repos_url":"https://api.github.com/users/xitep/repos","events_url":"https://api.github.com/users/xitep/events{/privacy}","received_events_url":"https://api.github.com/users/xitep/received_events","type":"User","site_admin":false},"created_at":"2016-08-01T06:26:53Z","updated_at":"2016-08-01T06:26:53Z","body":"@Hoverbear that's a good idea! thanks for the hint, i'll try that out."}}
{"actor":{"display_login":"xitep"}}