{"action":"created","issue":{"url":"https://api.github.com/repos/boto/s3transfer/issues/21","repository_url":"https://api.github.com/repos/boto/s3transfer","labels_url":"https://api.github.com/repos/boto/s3transfer/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/boto/s3transfer/issues/21/comments","events_url":"https://api.github.com/repos/boto/s3transfer/issues/21/events","html_url":"https://github.com/boto/s3transfer/pull/21","id":163466003,"number":21,"title":"Wrap upload bodies with InterruptReader","user":{"login":"kyleknap","id":4605355,"avatar_url":"https://avatars.githubusercontent.com/u/4605355?v=3","gravatar_id":"","url":"https://api.github.com/users/kyleknap","html_url":"https://github.com/kyleknap","followers_url":"https://api.github.com/users/kyleknap/followers","following_url":"https://api.github.com/users/kyleknap/following{/other_user}","gists_url":"https://api.github.com/users/kyleknap/gists{/gist_id}","starred_url":"https://api.github.com/users/kyleknap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyleknap/subscriptions","organizations_url":"https://api.github.com/users/kyleknap/orgs","repos_url":"https://api.github.com/users/kyleknap/repos","events_url":"https://api.github.com/users/kyleknap/events{/privacy}","received_events_url":"https://api.github.com/users/kyleknap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/boto/s3transfer/labels/needs-review","name":"needs-review","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-01T20:08:45Z","updated_at":"2016-07-05T21:35:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/boto/s3transfer/pulls/21","html_url":"https://github.com/boto/s3transfer/pull/21","diff_url":"https://github.com/boto/s3transfer/pull/21.diff","patch_url":"https://github.com/boto/s3transfer/pull/21.patch"},"body":"This is the second part needed to quickly cancel all transfers.\r\n\r\nThis enables the interruption of a socket while it reads so that the entire body does not have to be uploaded before a transfer can be cancelled. So you can do something like this:\r\n```py\r\nimport boto3\r\nfrom s3transfer.manager import TransferManager\r\n\r\nclient = boto3.client('s3')\r\n\r\nwith TransferManager(client) as m:\r\n    future1 = m.upload('100MB', 'mybucket', '100MB-upload')\r\n    future1.result()\r\n```\r\nAnd should be able to get it cancel using Cntrl-C within a couple of seconds.\r\n\r\nI also considered wrapping the fileobj ``PutObjectTask`` and ``UploadPartTask`` but that would require me to implement a lot of the interfaces provided by ``ReadFileChunk``, which is the current top wrapper layer, and that did not make sense because I would have to enable and disable callbacks.\r\n\r\nI am not sure if it is strange that I pass the TransferCoordinator now to the UploadInputManagers, but I figured it is acceptable because it now matches the initializer for the DownloadOutputManager.\r\n\r\ncc @jamesls @JordonPhillips "},"comment":{"url":"https://api.github.com/repos/boto/s3transfer/issues/comments/230610193","html_url":"https://github.com/boto/s3transfer/pull/21#issuecomment-230610193","issue_url":"https://api.github.com/repos/boto/s3transfer/issues/21","id":230610193,"user":{"login":"jamesls","id":368057,"avatar_url":"https://avatars.githubusercontent.com/u/368057?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesls","html_url":"https://github.com/jamesls","followers_url":"https://api.github.com/users/jamesls/followers","following_url":"https://api.github.com/users/jamesls/following{/other_user}","gists_url":"https://api.github.com/users/jamesls/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesls/subscriptions","organizations_url":"https://api.github.com/users/jamesls/orgs","repos_url":"https://api.github.com/users/jamesls/repos","events_url":"https://api.github.com/users/jamesls/events{/privacy}","received_events_url":"https://api.github.com/users/jamesls/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T21:35:26Z","updated_at":"2016-07-05T21:35:26Z","body":":shipit:"}}
{"actor":{"display_login":"jamesls"}}