2 releases

0.1.1 Apr 12, 2023
0.1.0 Nov 14, 2022

#149 in #streaming

Download history 29/week @ 2024-06-16 18/week @ 2024-06-23 25/week @ 2024-06-30 23/week @ 2024-07-07 5/week @ 2024-07-14 15/week @ 2024-07-21 49/week @ 2024-07-28 17/week @ 2024-08-04 28/week @ 2024-08-11 3/week @ 2024-08-18 16/week @ 2024-08-25 22/week @ 2024-09-01 20/week @ 2024-09-08 4/week @ 2024-09-22 30/week @ 2024-09-29

55 downloads per month

MIT license

77KB
1.5K SLoC

Docs.rs crates.io

SignalRs

SignalRs is Rust's implementation of SignalR protocol.

SignalR is an open-source protocol that simplifies adding real-time web functionality to apps. Real-time web functionality enables server-side code to push content to clients instantly.

This library is an open source implementation of this protocol's client in Rust. Originally developed at Microsoft in .NET ecosystem. Read more about it in offical documentation.

In technical terms it is a RPC framework with bidirectional streaming capabilities.

See docs.rs or examples folders of appropriate crates to see how to use it.

Why SignalR

Ergonomics

It allows bidirectional communication with ergonimic programming model. In cases where real-time communication is required it provides an easy to use framework, abstracting underlying transport layer. Getting WebSockets right is not an easy task.

Integration with existing services

Since SignalR originated in .NET ecosystem, there are services that expose SignalR endpoints. This library allows easy integration with them. This might be especially true for internal tooling at companies that do mostly C#. Truth to be told, it was a reason this library was created in the first place.

Features 🚀

This library is not feature-full and is not battle-tested. It is suitable for internal tooling and personal projects at the moment.

If you happen to find a bug or missing feature - please file an issue.

Client

Client currently supports:

  • call servers with value and stream arguments
  • send a message and:
    • do not wait for a response
    • wait for a single response
    • wait for stream of responses
  • have a client-side hub that supports
    • value arguments
  • WebSockets
  • JSON

Client does not support (yet):

  • stream arguments to client-side hubs
  • LongPolling
  • ServerSentEvents
  • MsgPack

To view source code of the client see signalrs-client crate in this repository.

Server

Server is a work in progress. It is pretty much advanced and runs, but is not released yet. To view its source code see signalrs-next crate in this repository.

Testing

  • Cross-platform testing with:
    • .NET client implementation

References

Internals of the protocol were implemented based on following:

Dependencies

~16–30MB
~594K SLoC