Skip to content

An example implementation of a publisher-subscriber distributed system that communicates via QUIC.

License

Notifications You must be signed in to change notification settings

varfrog/quic-pub-sub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QUIC Pub Sub

About

This project contains 3 services that communicate via QUIC:

  1. Server (in /server)
  2. Publisher (in /publisher)
  3. Subscriber (in /subscriber)
  • Publishers and Subscribers connect to the Server
  • Publishers send periodic messages to the Server if and only if there are subscribers connected to the Server
  • The Server sends out messages from Publishers to all connected Subscribers.

Running the apps

Generate TLS certificates before the first run:

bash gen_certs.sh

Build:

go build -o bin/server ./server
go build -o bin/publisher ./publisher
go build -o bin/subscriber ./subscriber

From the project root:

  1. build the server
./bin/server
  1. open publishers as subscribers from different shells:
./bin/publisher
./bin/subscriber

If the commands complain, run them with -help to see how to modify parameters.

Notes

Relationships

In each app:

  • Package transport contains code for remote communication and passes data onto the app package if one exists,
  • Package app contains the logical part of the server, excluding any data transport/RPC specifics.

Directories "internal"

Packages internal might not be necessary but they are here to signify (and enforce by the compiler) that code is not shared between each of the 3 services, as they all live in the same project. The code that is shared lives in pkg.

Loggers

Loggers are passed to constructors as arguments, not via Options, this is a todo.

Testing

go test ./...

Generate mocks if they need to change

go generate ./...

About

An example implementation of a publisher-subscriber distributed system that communicates via QUIC.

Topics

Resources

License

Stars

Watchers

Forks