{"action":"created","issue":{"url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/7","repository_url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console","labels_url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/7/comments","events_url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/7/events","html_url":"https://github.com/pieceofsummer/Hangfire.Console/issues/7","id":187978084,"number":7,"title":"Progress bar enhancement","user":{"login":"waynebrantley","id":157082,"avatar_url":"https://avatars.githubusercontent.com/u/157082?v=3","gravatar_id":"","url":"https://api.github.com/users/waynebrantley","html_url":"https://github.com/waynebrantley","followers_url":"https://api.github.com/users/waynebrantley/followers","following_url":"https://api.github.com/users/waynebrantley/following{/other_user}","gists_url":"https://api.github.com/users/waynebrantley/gists{/gist_id}","starred_url":"https://api.github.com/users/waynebrantley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waynebrantley/subscriptions","organizations_url":"https://api.github.com/users/waynebrantley/orgs","repos_url":"https://api.github.com/users/waynebrantley/repos","events_url":"https://api.github.com/users/waynebrantley/events{/privacy}","received_events_url":"https://api.github.com/users/waynebrantley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-08T12:21:15Z","updated_at":"2016-11-10T21:15:56Z","closed_at":"2016-11-08T23:19:19Z","body":"Many times when using a progress bar, we are in a for-each loop.   \r\nLooks something like this:\r\n\r\n```\r\nint pos=0;\r\nint max=6200;\r\nvar bar=PerformContext.WriteProgressBar();\r\nforeach (var item in collection)\r\n{\r\n   SomeWork();\r\n   pos++\r\n   bar.SetPos(pos/max*100);\r\n}\r\n```\r\n\r\nGiven that is such a common pattern, perhaps a simple enhancement would have it also work like this:\r\n\r\n```\r\nvar bar=PerformContext.WriteProgressBar(6200);  (pass in the max)\r\nforeach (var item in collection)\r\n{\r\n   SomeWork();\r\n   bar.IncRelativePos();\r\n}\r\n```\r\n\r\nWhere the progress bar instance maintains the state, etc.   ( Additionally, this would enable a feature where the progress bar shows est time remaining instead of % complete - since it could track how long it has been and has all other info needed)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/comments/259809672","html_url":"https://github.com/pieceofsummer/Hangfire.Console/issues/7#issuecomment-259809672","issue_url":"https://api.github.com/repos/pieceofsummer/Hangfire.Console/issues/7","id":259809672,"user":{"login":"waynebrantley","id":157082,"avatar_url":"https://avatars.githubusercontent.com/u/157082?v=3","gravatar_id":"","url":"https://api.github.com/users/waynebrantley","html_url":"https://github.com/waynebrantley","followers_url":"https://api.github.com/users/waynebrantley/followers","following_url":"https://api.github.com/users/waynebrantley/following{/other_user}","gists_url":"https://api.github.com/users/waynebrantley/gists{/gist_id}","starred_url":"https://api.github.com/users/waynebrantley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waynebrantley/subscriptions","organizations_url":"https://api.github.com/users/waynebrantley/orgs","repos_url":"https://api.github.com/users/waynebrantley/repos","events_url":"https://api.github.com/users/waynebrantley/events{/privacy}","received_events_url":"https://api.github.com/users/waynebrantley/received_events","type":"User","site_admin":false},"created_at":"2016-11-10T21:15:56Z","updated_at":"2016-11-10T21:15:56Z","body":"If I have an array, still in the same boat.\r\nAny consideration of \r\nvar bar=PerformContext.WriteProgressBar(6200);  (pass in the max)...where the max simply defaults to 100 (which is what it does now)\r\n\r\nand \r\n\r\nbar.IncRelativePos();  that increments the position and sends in position/max*100 to setvalue?\r\n"}}
{"actor":{"display_login":"waynebrantley"}}