MessagePipe — High performance messaging library for .NET and Unity

  • sync/async
  • keyed/keyless
  • buffered/bufferless
  • broadcast/response(+many)
  • in-memory/distributed

Managing Subscription

In MessagePipe, the return value IDisposable must be handled in some way. If you ignore it, it will leak. However, there is always the possibility of leaks (e.g., if the IDisposable is tied to a lifecycle object, the lifecycle object may not be handled properly and the subscription may remain). Therefore, MessagePipe allows you to centrally get the number of all subscriptions and, if necessary, the stack trace at the time of subscribe.

Conclusion

I didn’t introduce it in this article, AsyncPublisher can wait for asynchronous processing of all subscribers by await(which is not possible with normal events or Rx), IDistributedPublisher/Subscriber allows PubSub not only in-memory but also over the network, and Filter hooks before and after every send and receive for both sync and async.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Yoshifumi Kawai

Yoshifumi Kawai

a.k.a. neuecc. Creator of UniRx, UniTask, MessagePack for C#, MagicOnion etc. Microsoft MVP for C#. CEO/CTO of Cysharp Inc. Live and work in Tokyo, Japan.