ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - suvash/hulaaki: DEPRECATED : An Elixir library (driver) for clients communicating with MQTT brokers(via the MQTT 3.1.1 protocol).
DEPRECATED : An Elixir library (driver) for clients communicating with MQTT brokers(via the MQTT 3.1.1 protocol). - suvash/hulaaki
Visit Site

GitHub - suvash/hulaaki: DEPRECATED : An Elixir library (driver) for clients communicating with MQTT brokers(via the MQTT 3.1.1 protocol).

GitHub - suvash/hulaaki: DEPRECATED : An Elixir library (driver) for clients communicating with MQTT brokers(via the MQTT 3.1.1 protocol).

DEPRECATED : Hulaaki (हुलाकी)

Further DEVELOPMENT of this library has now been STOPPED. Please consider looking into other alternatives. (such as tortoise)

Build Status Coverage Status Hex.pm Project Inline docs

An Elixir library (driver) for clients communicating with MQTT brokers(via the MQTT 3.1.1 protocol).

A quick tour of the features implemented right now:

  • Qos 0 and Qos 1 support available. QoS 2 not supported yet.
  • SSL/TLS support available.
  • Automatic Ping based on keep alive timeout.
  • Internal packet id generation for control packets with variable header.

Naming

Hulaaki(pronouced as who-laa-key) is the phonetic spelling of the word हुलाकी in Nepali, which translates to postman.

Usage

Before we get started, keep in mind that you need a running MQTT server that you can connect to.

Add Hulaaki to your project dependencies in mix.exs

def deps do
  [{:hulaaki, "~> 0.1.2"} ]
end

The quickest way to get up and running with Hulaaki is to use the provided Client module. This Genserver module defines function callbacks that are intended to be overridden for required implementations. The callbacks are defined for each MQTT message that is being sent and received from the server.

Here's a list of all the override-able callbacks touse in your projects.

An example is present below that overrides some callbacks.

defmodule SampleClient do
  use Hulaaki.Client

  def on_connect_ack(options) do
    IO.inspect options
  end

  def on_subscribed_publish(options) do
    IO.inspect options
  end

  def on_subscribe_ack(options) do
    IO.inspect options
  end

  def on_ping_response(options) do
    IO.inspect options
  end
end

Load the project in iex -S mix to explore the SampleClient

$ iex -S mix

> {:ok, pid} = SampleClient.start_link(%{})

> options = [client_id: "some-name-7490", host: "localhost", port: 8883, ssl: true]

> SampleClient.connect(pid, options)

> SampleClient.ping(pid)

Please check the inline documentation and client_tcp_test.exs for more example usage and test strategy.

Changelog

Please check the CHANGELOG.md.

Documentation

Please refer to the inline documentation and client tests to explore the documentation for now.

Contributing

Pull requests with appropriate tests and improvements are welcome. Mosquitto is currently used by the author to test the library.

Running the tests

If you already have Elixir runtime and a MQTT broker running (on standard ports), you should just be able to run mix test as you would do on other mix projects.

As prefered by the author, you can also use the provided Makefile to run the tests. In that case, you'll need the following on your machine

  • GNU Make ( Version 4.0 and up )
  • Docker Engine ( Version 17.06.1 and hopefully upwards )
  • Docker Compose ( Version 1.16.1 and hopefully upwards )
# Get help
$ make help

# Start the MQTT servers (better to start separately to warm them up)
$ make start

# Run tests
$ make test

# Stop and cleanup docker instances etc.
# make stop

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory