Guest User

Untitled

a guest
Feb 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. public sealed class EventConsumerBootstrap : ILifecycleParticipant<ISiloLifecycle>
  2. {
  3. private readonly IGrainFactory grainFactory;
  4.  
  5. public EventConsumerBootstrap(IGrainFactory grainFactory)
  6. {
  7. Guard.NotNull(grainFactory, nameof(grainFactory));
  8.  
  9. this.grainFactory = grainFactory;
  10. }
  11.  
  12. public void Participate(ISiloLifecycle lifecycle)
  13. {
  14. lifecycle.Subscribe(SiloLifecycleStage.SiloActive, ct =>
  15. {
  16. return grainFactory.GetGrain<IEventConsumerManagerGrain>("Default").ActivateAsync();
  17. });
  18. }
  19. }
Add Comment
Please, Sign In to add comment