{"action":"created","issue":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/3568","repository_url":"https://api.github.com/repos/Particular/NServiceBus","labels_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3568/labels{/name}","comments_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3568/comments","events_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3568/events","html_url":"https://github.com/Particular/NServiceBus/pull/3568","id":139278251,"number":3568,"title":"[WIP] Adding a pipeline completed event","user":{"login":"andreasohlund","id":125028,"avatar_url":"https://avatars.githubusercontent.com/u/125028?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasohlund","html_url":"https://github.com/andreasohlund","followers_url":"https://api.github.com/users/andreasohlund/followers","following_url":"https://api.github.com/users/andreasohlund/following{/other_user}","gists_url":"https://api.github.com/users/andreasohlund/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasohlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasohlund/subscriptions","organizations_url":"https://api.github.com/users/andreasohlund/orgs","repos_url":"https://api.github.com/users/andreasohlund/repos","events_url":"https://api.github.com/users/andreasohlund/events{/privacy}","received_events_url":"https://api.github.com/users/andreasohlund/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/Maintainer:%20@danielmarbach","name":"Maintainer: @danielmarbach","color":"2F3765"},{"url":"https://api.github.com/repos/Particular/NServiceBus/labels/Maintainer:%20@timbussmann","name":"Maintainer: @timbussmann","color":"2F3765"}],"state":"open","locked":false,"assignee":{"login":"andreasohlund","id":125028,"avatar_url":"https://avatars.githubusercontent.com/u/125028?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasohlund","html_url":"https://github.com/andreasohlund","followers_url":"https://api.github.com/users/andreasohlund/followers","following_url":"https://api.github.com/users/andreasohlund/following{/other_user}","gists_url":"https://api.github.com/users/andreasohlund/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasohlund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasohlund/subscriptions","organizations_url":"https://api.github.com/users/andreasohlund/orgs","repos_url":"https://api.github.com/users/andreasohlund/repos","events_url":"https://api.github.com/users/andreasohlund/events{/privacy}","received_events_url":"https://api.github.com/users/andreasohlund/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2016-03-08T13:30:05Z","updated_at":"2016-03-11T08:26:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Particular/NServiceBus/pulls/3568","html_url":"https://github.com/Particular/NServiceBus/pull/3568","diff_url":"https://github.com/Particular/NServiceBus/pull/3568.diff","patch_url":"https://github.com/Particular/NServiceBus/pull/3568.patch"},"body":"In order to fix https://github.com/Particular/NServiceBus/issues/3565 I needed a way to get notified after the pipeline has completed. After talking to @timbussmann I added an event aggregator to do this since we want to move away from hardcoding things on `BusNotifications`. To demonstrate the usage I refactored the current error notifications to be driven by this \"event\" instead. That really cleaned up the recoverability code.\r\n\r\nIf we're happy with this approach I'll go ahead and fix #3565 based on this.\r\n\r\nI would also propose that we go ahead and retire the current error notifications in favor of this method like discussed in https://github.com/Particular/PlatformDevelopment/issues/605. But that can be discussed separately.\r\n\r\n#### Details\r\n\r\n* I changed what I believe was [an invalid assertion](https://github.com/Particular/NServiceBus/pull/3568/files#diff-a8ffdd5b3ddae68e362456faeb0d634bR28). We now invoke the FLR event 3*3=> 9 times which I believe is the correct number since we have FLR set to 3 and FLR 2 => 3 * (1(initial try) '+2(SLR)) == 9.\r\n* RIP `class UnicastBus: Feature`\r\n* Will enable us to fix https://github.com/Particular/NServiceBus/issues/3079\r\n* Switches the tests over to use fake contexts instead of the real transport receive context\r\n\r\nRelated to #3425 "},"comment":{"url":"https://api.github.com/repos/Particular/NServiceBus/issues/comments/195254824","html_url":"https://github.com/Particular/NServiceBus/pull/3568#issuecomment-195254824","issue_url":"https://api.github.com/repos/Particular/NServiceBus/issues/3568","id":195254824,"user":{"login":"danielmarbach","id":174258,"avatar_url":"https://avatars.githubusercontent.com/u/174258?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmarbach","html_url":"https://github.com/danielmarbach","followers_url":"https://api.github.com/users/danielmarbach/followers","following_url":"https://api.github.com/users/danielmarbach/following{/other_user}","gists_url":"https://api.github.com/users/danielmarbach/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmarbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmarbach/subscriptions","organizations_url":"https://api.github.com/users/danielmarbach/orgs","repos_url":"https://api.github.com/users/danielmarbach/repos","events_url":"https://api.github.com/users/danielmarbach/events{/privacy}","received_events_url":"https://api.github.com/users/danielmarbach/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T08:26:21Z","updated_at":"2016-03-11T08:26:21Z","body":"I see the value of this one but still I'm a bit on the fence about the event aggregator implementation. Have we considered the implications of the simple aggregator we have here?\r\n\r\n@timbussmann mentioned thread safety. Another one would be keeping hard references potentially. So, for example, how Caliburn.Micro does it:\r\n\r\nhttps://github.com/Caliburn-Micro/Caliburn.Micro/blob/master/src/Caliburn.Micro/EventAggregator.cs\r\n\r\nYes, of course, they use another approach that you implement a handler interface similar to `IHandleMessages` and, therefore, the reference issue becomes more apparent. But keeping anonymous delegates also has implications.\r\n\r\nAlso the point about exception bubbling. I think since it is a notification the core doesn't really care about exceptions happening inside a subscriber."}}