Description
Changelog
Reviews (0)

Decoupled messaging for Godot .NET

eMessagePipe brings Cysharp’s MessagePipe to Godot .NET projects. MessagePipe is an in-memory messaging library for .NET: publishers send typed messages, and subscribers handle them without either side needing a direct reference to the other. This helps keep scenes, services, and game systems independent and easier to test.

What eMessagePipe adds

  • Self-installing packages: Enable eMessagePipe through the ePlugin Framework to add the MessagePipe and MessagePipe.Analyzer NuGet packages (MessagePipe 1.8.2) to your Godot C# project. A welcome page shows the first steps.
  • Node-bound subscriptions: AddTo(node) disposes a subscription, or any other IDisposable, when its node is freed. Reparenting the node keeps the subscription alive, and it works even while the node is still setting up its children.
  • Main-thread handlers: MainThreadMessageHandlerFilter<T> and MainThreadAsyncMessageHandlerFilter<T> run handlers on Godot’s main thread, so messages published from worker threads can safely update nodes. Set Owner to skip handlers whose node has already been freed. Use them per subscription or for every message type.
  • Optional eContainer integration: With eContainer enabled, call RegisterMessagePipe() once in a LifetimeScope, and publishers, subscribers, and request handlers resolve for every message type in that scope and its child scopes, alongside your other services. RegisterMessageBroker<TMessage>() gives a child scope its own broker for a specific message type, and RegisterGlobalMessagePipe() provides GlobalMessagePipe from the root scope.
  • In-editor updates: Check for, install, and roll back eMessagePipe releases from the ePlugin Manager.

The Godot helpers work with or without eContainer, so you can also use MessagePipe with your preferred dependency injection setup.

MessagePipe features

  • Typed publish/subscribe: Publish messages through IPublisher<TMessage> and receive them through ISubscriber<TMessage>. Subscriptions return IDisposable; group them with DisposableBag or tie them to a node with AddTo(node).
  • Asynchronous messaging: Use async publishers and subscribers to await handlers, choose parallel or sequential execution, and pass cancellation tokens.
  • Keyed brokers: Route the same message type by key, such as an entity, channel, or game state.
  • Buffered brokers: Retain the most recent message and replay it to new subscribers.
  • Request handlers: Send a request to one handler or fan it out to multiple handlers and collect responses. Async request handlers are also supported.
  • Filters: Add ordered handler middleware for cross-cutting behavior such as logging, validation, or filtering, applied globally, per subscription, or by attribute.
  • Diagnostics and analyzer: Inspect live subscription counts, capture subscription creation locations, and use the included analyzer to flag discarded subscription disposables.

Requirements and notes

  • Requires a Godot 4.4 .NET project and the ePlugin Framework (0.9.0 or newer for updates through the ePlugin Manager).
  • eContainer is optional and required only for the VContainer integration. It can be enabled before or after eMessagePipe.
  • Without eContainer, add a dependency injection container such as Microsoft.Extensions.DependencyInjection to build MessagePipe’s service provider; MessagePipe itself only includes the abstractions.
  • Distributed transports such as Redis, WebSocket, and gRPC are separate MessagePipe packages and are not installed by eMessagePipe.
  • This project is experimental and still in progress.

Changelog for version v0.4.0

2026-10-21 13:36:00

No changelog provided for this version.

Reviews

eMessagePipe has no reviews yet.

Login to write a review.

Consider supporting the creators!

If you enjoyed this asset consider supporting its creator. Follow the link below.