infotainer

Crates.ioinfotainer
lib.rsinfotainer
version0.0.1-alpha.1
sourcesrc
created_at2021-01-15 02:15:00.514516
updated_at2021-07-14 22:01:12.630623
descriptionbuilding blocks for simple pubsub services
homepage
repositoryhttps://github.com/joppich/infotainer
max_upload_size
id342188
size105,702
(joritkm)

documentation

README

WIP: infotainer

Test codecov

Note: At the moment, this project is intended for me to learn and implement stuff I'm interested in. It's not really of any practical use to anyone.

Infotainer contains building blocks for simple pubsub services based on actix/-web, cbor and websockets.

Components

The websocket interface is an actor whose handlers are largely built around the ClientCommand and ServerResponse types. ClientCommand consists of struct variants holding data sent from client to server. These are translated into actix Messages by the WebSocketSession actor.
The ServerResponse type is used to wrap data sent from server to client and can contain HashSet<Uuid>, representing a subscriptions log index, Publication, representing data published by some client, or DataLogEntry, containing one or more Publications previously submitted to the data log.

The pubsub service actor handles the SubmitCommand and ManageSubscription messages. When data is submitted for publication, the actor looks up the addressed Subscription, generates a Publication, sends it, wrapped in a DataLogPut message, to the DataLogger and proceeds to distribute it to connected clients subscribed to the Subscription.
ManageSubscription has two variants, Add and Remove, and is used by clients to un-/subscribe from/to Subscriptions.

DatalogService enables persisting the server state as well as published data. DataLogPut messages represent write requests for SubscriptionMeta, subscriber lists and Publications. DataLogFetch messages are used to retrieve persisted data. Additionally, it maintains a log of subscriptions and their publications.

Features

  • websocket interface/ client message types
  • Subscription/Subscription table
  • Broadcast-type subscriptions
  • Queue-type subscriptions
  • Publication
  • publishing messages
  • session management
  • data log service
  • persisting/retrieval of publication data
  • persisting/retrieval of subscription metadata
  • recreating server state from persisted data

Is it any good?

yes

Commit count: 98

cargo fmt