{"action":"created","issue":{"url":"https://api.github.com/repos/ensime/ensime-server/issues/1436","repository_url":"https://api.github.com/repos/ensime/ensime-server","labels_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/labels{/name}","comments_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/comments","events_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436/events","html_url":"https://github.com/ensime/ensime-server/pull/1436","id":152469457,"number":1436,"title":"WIP reduce memory pressure during SearchService.refresh","user":{"login":"ChrisCoffey","id":5373301,"avatar_url":"https://avatars.githubusercontent.com/u/5373301?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisCoffey","html_url":"https://github.com/ChrisCoffey","followers_url":"https://api.github.com/users/ChrisCoffey/followers","following_url":"https://api.github.com/users/ChrisCoffey/following{/other_user}","gists_url":"https://api.github.com/users/ChrisCoffey/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisCoffey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisCoffey/subscriptions","organizations_url":"https://api.github.com/users/ChrisCoffey/orgs","repos_url":"https://api.github.com/users/ChrisCoffey/repos","events_url":"https://api.github.com/users/ChrisCoffey/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisCoffey/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ensime/ensime-server/labels/Needs%20Review","name":"Needs Review","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-02T01:40:46Z","updated_at":"2016-05-04T08:11:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ensime/ensime-server/pulls/1436","html_url":"https://github.com/ensime/ensime-server/pull/1436","diff_url":"https://github.com/ensime/ensime-server/pull/1436.diff","patch_url":"https://github.com/ensime/ensime-server/pull/1436.patch"},"body":"This is still under construction, but there are a couple of approaches I've considered for #1341\r\n\r\n- Synchronize the refresh flow as much as possible. Certainly introduces \"backpressure\", but it also feels like we're loosing out on some parallelism here\r\n- Use a bounded queue & `CallerRunsPolicy` once the queue is full. With a queue of size one, this means we'll begin using the calling thread for overflow work, which in turn slows down the caller, applying some back pressure\r\n- Introduce a custom `RejectedExecutionHandler` policy that actually blocks the caller rather than delegate work to it. This seems like overkill for what we need.\r\n\r\nI toyed around with the 3rd option, but ended up settling on the `CallerRunsPolicy` approach. I want to make sure this passes tests up here, and in the meantime I'll remove the old `val handler`. "},"comment":{"url":"https://api.github.com/repos/ensime/ensime-server/issues/comments/216777294","html_url":"https://github.com/ensime/ensime-server/pull/1436#issuecomment-216777294","issue_url":"https://api.github.com/repos/ensime/ensime-server/issues/1436","id":216777294,"user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T08:11:39Z","updated_at":"2016-05-04T08:11:39Z","body":"@ChrisCoffey before I start teaching granny to suck eggs, how much of the reactive manifesto and sequential concurrent programming are you familiar with?\r\n\r\nThere is so much buzzword bingo around the reactive manifesto that I wouldn't even consider sending you near it if you're new to it, but for SCP (and perhaps other paradigms that may be new to you) I strongly recommend Seven Concurrency Models in Seven Weeks by Paul Butcher. Clojure is used as the example but there is a scala implementation (not battle tested) in #1351 which could form the basis of a better model than akka going forward."}}