Home

Awesome

VitalRouter

GitHub license Unity 2022.2+

VitalRouter, is a source-generator powered zero-allocation fast in-memory messaging library for Unity and .NET.

It can declaratively do async handler/async middleware/sequence control, etc., and could serve as a thin framework to promote unidirectional control flow.

Diagram

In games, or complex GUI application development, patterns such as central event aggregator/message broker/mediator are powerful patterns to organize N:N relationships. Assembling an asynchronous function pipeline can be even more effective.

Features

Documentation

Visit vitalrouter.hadashikick.jp to see the full documentation.

Installation

Unity

Then, add git URL from Package Manager:

https://github.com/hadashiA/VitalRouter.git?path=/src/VitalRouter.Unity/Assets/VitalRouter#1.6.0

.NET

THe following NuGet packages are available.

PackageLatest version
VitalRouterNuGet
VitalRouter.Extensions.DependencyInjectionNuGet

[!NOTE] For Unity, use of the above package is recommended instead of Nuget.

Async interceptor pipeline

Pipelining of async interceptors for published messages is possible. This is a general strong pattern for data exchange.

<img src="./website/docs/assets/diagram_interceptors.svg" alt="Interceptor Diagram" width="50%" />

Read more

UniTask Integration

UniTask is a fast async/await extension for Unity. VitalRouter actively supports UniTask.

Read more

R3 Integration

R3 is the next generation Reactive Extensions implementation in the C# world. It is an excellent alternative to asynchronous streams, but also an excellent alternative to local events.

VitalRouter supports the ability to work with R3.

Read more

MRuby scripting?

It is very powerful if the publishing of commands can be controlled by external data.

For example, when implementing a game scenario, most of the time we do not implement everything in C# scripts. It is common to express large amounts of text data, branching, flag management, etc. in a simple scripting language or data format.

VitalRouter offers an optional package for this purpose before integrating mruby. (blog / blog (Japanease)

Fiber in mruby and async/await in C# are fully integrated.

MRuby and C# Diagram

Read more

LISENCE

MIT

AUTHOR

@hadashiA