Skip to content

Simple Actor system using Rust and Coerce, used as a playground

Notifications You must be signed in to change notification settings

flo-ride/Actor_Discovery

Repository files navigation

Actor Discovery

By Florian "FloRide" Reimat

About

This is a simple Actor model project, using Rust and Coerce. I've used it as a learning plateform.

Architecture

graph TB;
    id{MQTT} --> Reader

    Reader --> Persistence
    Reader --> Parser

    Parser --> User
    Parser --> Notification

    User --> Parser


    Persistence --> id1[(Database)]
    User --> id1[(Database)]
    id1[(Database)] --> User
Loading

Each square nodes represent an unique actor

Standalone Project

How to launch it

Examples environnement variables:

# DB
POSTGRES_USER="postgres"                                # Database user connection
POSTGRES_PASSWORD="postgres"                            # Database password connection
POSTGRES_PORT=5432                                      # Database port
POSTGRES_HOST="localhost"                               # Database host
POSTGRES_DB="actor_discovery"                           # Database name

DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"

# MQTT
MQTT_HOST="localhost"                                   # The MQTT host server
MQTT_PORT=1883                                          # The MQTT port server

Run commands:

# Setup .env
touch .env
$EDITOR .env # Use your favorite editor

# If you are on nix
# nix-shell

# Debug | Run
cargo run

# Build
cargo build --release

Docker

# Setup .env
cp .env.default .env

# Run
docker-compose run -d

Please don't forget to setup the env file before launching the docker-compose. The default .env file is this one .env.default.

About

Simple Actor system using Rust and Coerce, used as a playground

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published