{"action":"opened","issue":{"url":"https://api.github.com/repos/gregoryyoung/m-r/issues/4","labels_url":"https://api.github.com/repos/gregoryyoung/m-r/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/gregoryyoung/m-r/issues/4/comments","events_url":"https://api.github.com/repos/gregoryyoung/m-r/issues/4/events","html_url":"https://github.com/gregoryyoung/m-r/issues/4","id":53764989,"number":4,"title":"Race between event handlers and read model facade after commands","user":{"login":"t-nelis","id":5138441,"avatar_url":"https://avatars.githubusercontent.com/u/5138441?v=3","gravatar_id":"","url":"https://api.github.com/users/t-nelis","html_url":"https://github.com/t-nelis","followers_url":"https://api.github.com/users/t-nelis/followers","following_url":"https://api.github.com/users/t-nelis/following{/other_user}","gists_url":"https://api.github.com/users/t-nelis/gists{/gist_id}","starred_url":"https://api.github.com/users/t-nelis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t-nelis/subscriptions","organizations_url":"https://api.github.com/users/t-nelis/orgs","repos_url":"https://api.github.com/users/t-nelis/repos","events_url":"https://api.github.com/users/t-nelis/events{/privacy}","received_events_url":"https://api.github.com/users/t-nelis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-08T15:50:56Z","updated_at":"2015-01-08T15:50:56Z","closed_at":null,"body":"In case anyone's wondering, there are races between event handlers and the read model facade after commands are issued. This is due to the use of `ThreadPool.QueueUserWorkItem` in `FakeBus.Publish`.\r\n\r\nYou can test one for example by creating a new item and freezing one of the threads handling the `InventoryItemCreated` event (simulating a long database request); the resulting view will not display the item you just created.\r\n\r\nNote that this is no eventual consistency matter.\r\n\r\nThis shouldn't impact the overall architecture which is the point of this project -- just pointing this out so that nobody embarks on a journey looking for magic and finding bugs instead."}}