{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-http/issues/271","repository_url":"https://api.github.com/repos/akka/akka-http","labels_url":"https://api.github.com/repos/akka/akka-http/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/271/comments","events_url":"https://api.github.com/repos/akka/akka-http/issues/271/events","html_url":"https://github.com/akka/akka-http/issues/271","id":176357952,"number":271,"title":"How to cleanup after response in akka-http","user":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/akka/akka-http/milestones/5","html_url":"https://github.com/akka/akka-http/milestones/http-backlog","labels_url":"https://api.github.com/repos/akka/akka-http/milestones/5/labels","id":1991250,"number":5,"title":"http-backlog","description":"","creator":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"open_issues":79,"closed_issues":14,"state":"open","created_at":"2016-09-08T14:27:28Z","updated_at":"2016-09-12T11:59:02Z","due_on":null,"closed_at":null},"comments":17,"created_at":"2016-09-12T11:59:02Z","updated_at":"2016-09-12T11:59:18Z","closed_at":null,"body":"<a href=\"https://github.com/adamretter\"><img src=\"https://avatars.githubusercontent.com/u/1264057?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [adamretter](https://github.com/adamretter)**\n_Saturday Sep 26, 2015 at 22:10 GMT_\n_Originally opened as https://github.com/akka/akka/issues/18571_\n\n----\n\nI am using the routing DSL in Akka HTTP.\r\n\r\nI extract a file from a Multipart form upload request and write it to a temporary location on disk, I then process that file which creates a second temporary file.\r\n\r\nI return the second temporary file as my response to the user. However, once the response has been sent to the user, I would like to delete the two temporary files that I created.\r\n\r\nMy route contains something like this:\r\n\r\n```\r\nencodeResponse {\r\n  complete(HttpResponse(OK, entity = HttpEntity(`application/pdf`, pdfResult.jfile: File)))\r\n}\r\n```\r\n\r\nMy question is how do I know when the response has been fully sent to the client so that I can delete the temporary `pdfResult` file from disk?\n"},"comment":{"url":"https://api.github.com/repos/akka/akka-http/issues/comments/246325879","html_url":"https://github.com/akka/akka-http/issues/271#issuecomment-246325879","issue_url":"https://api.github.com/repos/akka/akka-http/issues/271","id":246325879,"user":{"login":"akka-ci","id":2511948,"avatar_url":"https://avatars.githubusercontent.com/u/2511948?v=3","gravatar_id":"","url":"https://api.github.com/users/akka-ci","html_url":"https://github.com/akka-ci","followers_url":"https://api.github.com/users/akka-ci/followers","following_url":"https://api.github.com/users/akka-ci/following{/other_user}","gists_url":"https://api.github.com/users/akka-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/akka-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka-ci/subscriptions","organizations_url":"https://api.github.com/users/akka-ci/orgs","repos_url":"https://api.github.com/users/akka-ci/repos","events_url":"https://api.github.com/users/akka-ci/events{/privacy}","received_events_url":"https://api.github.com/users/akka-ci/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T11:59:17Z","updated_at":"2016-09-12T11:59:17Z","body":"<a href=\"https://github.com/ktoso\"><img src=\"https://avatars.githubusercontent.com/u/120979?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [ktoso](https://github.com/ktoso)**\n_Saturday Oct 10, 2015 at 21:18 GMT_\n\n----\n\nAlso, please check out the `fromFile` directive, it internally uses a SynchronousFileSink and is much easier to use :-)\n"}}
{"actor":{"display_login":"akka-ci"}}