mqtt_actor 0.2.1

An mqtt adaptors (from port and adaptors) to be used with actix actors.
Documentation
mqtt_actor-0.2.1 has been yanked.

Purpouse

The goal is use Mqtt with actors.

While using ports and adpates ( a.k.a. hexagonal architecture) we may want to use actix actors to implement the core. Specially if multiple protocols are to be used.

If one of those protocols is MQTT then this is the adapter you need.

Description

This crate is asyncrhonous and should be run within actix_rs executor.

Tough the name suggest this crate is about implementing the adapter as an actor, actually is not pure actor.

It has an actor to let you have an address to allow the core sending messages to topics: MqttPublisher, but the main job is carried by the struct: MqttConnectionManager, including connecting to the server and creating the former actor.

    package mqtt_actor {
        struct MqttConnectionManager{
            from(..) -> Self
            add_subscription(..)
            start()
            get_Publisher()
        }
        annotation MqttPublisher
        struct MqttPublisherActor
        struct MqttPublisherActor_mock #gray
        interface Subscription
        struct DumpHandler #white
        Struct EchoHandler #white
        struct "echoHandler <Handler<StringMessage>>" as strmsg #white

        MqttConnectionManager *-- MqttPublisher: publisher_actor
        MqttPublisher <|-- MqttPublisherActor
        MqttPublisher <|-- MqttPublisherActor_mock : <<unit test>>
        Subscription <|-- DumpHandler
        Subscription <|-- EchoHandler
        MqttPublisher ..|> strmsg : implement
        EchoHandler --> strmsg: calls

    }
    struct yourSubscription
    yourSubscription --|> Subscription
    yourSubscription --* MqttConnectionManager : 0:N

    struct yourActor #white
    yourSubscription -> yourActor: can call

    struct "your Handler <Handler<yourMessage>>" as message

    MqttPublisher ..|> message : implement
    yourActor --> message: can call

    



Usage