Current section
7 Versions
Jump to
Current section
7 Versions
Compare versions
4
files changed
+31
additions
-19
deletions
| @@ -2,6 +2,7 @@ | |
| 2 2 | |
| 3 3 | [](https://travis-ci.org/suvash/hulaaki?branch=master) |
| 4 4 | [](https://coveralls.io/r/suvash/hulaaki?branch=master) |
| 5 | + [](https://hex.pm/packages/hulaaki) |
| 5 6 | [](http://inch-ci.org/github/suvash/hulaaki?branch=master) |
| 6 7 | |
| 7 8 | An Elixir library (driver) for clients communicating with MQTT |
| @@ -13,6 +14,11 @@ A quick tour of the features implemented right now: | |
| 13 14 | - Automatic Ping based on keep alive timeout. |
| 14 15 | - Internal packet id generation for control packets with variable header. |
| 15 16 | |
| 17 | + ## Naming |
| 18 | + |
| 19 | + Hulaaki(pronouced as who-laa-key) is the phonetic spelling of the word |
| 20 | + हुलाकी in Nepali, which translates to postman. |
| 21 | + |
| 16 22 | ## Usage |
| 17 23 | |
| 18 24 | Before we get started, keep in mind that you need a running MQTT |
| @@ -22,7 +28,7 @@ Add Hulaaki to your project dependencies in `mix.exs` | |
| 22 28 | |
| 23 29 | ```elixir |
| 24 30 | def deps do |
| 25 | - [{:hulaaki, "~> 0.1.0"} ] |
| 31 | + [{:hulaaki, "~> 0.1.1"} ] |
| 26 32 | end |
| 27 33 | ``` |
| 28 34 | |
| @@ -74,13 +80,17 @@ $ iex -S mix | |
| 74 80 | ``` |
| 75 81 | |
| 76 82 | Please check the inline documentation |
| 77 | - and [client_test.exs](test/hulaaki/client_test.exs) for more example |
| 83 | + and [client_tcp_test.exs](test/hulaaki/client_tcp_test.exs) for more example |
| 78 84 | usage and test strategy. |
| 79 85 | |
| 86 | + ## Changelog |
| 87 | + |
| 88 | + Please check the [CHANGELOG.md](https://github.com/suvash/hulaaki/blob/master/CHANGELOG.md). |
| 89 | + |
| 80 90 | ## Documentation |
| 81 91 | |
| 82 | - Please refer to the inline documentation and tests to explore the |
| 83 | - documentation for now. |
| 92 | + Please refer to the inline documentation and client tests to explore |
| 93 | + the documentation for now. |
| 84 94 | |
| 85 95 | ## Contributing |
| 86 96 | |
| @@ -94,12 +104,17 @@ standard ports), you should just be able to run `mix test` as you | |
| 94 104 | would do on other mix projects. |
| 95 105 | |
| 96 106 | As prefered by the author, you can also use the provided Makefile to |
| 97 | - run the tests. The only dependency required is Docker on your machine. |
| 107 | + run the tests. In that case, you'll need the following on your machine |
| 108 | + - GNU Make ( Version 4.0 and up ) |
| 109 | + - [Docker Engine](https://docs.docker.com/engine/installation/) ( Version 17.06.1 and hopefully upwards ) |
| 110 | + - [Docker Compose](https://github.com/docker/compose/releases) ( Version 1.16.1 and hopefully upwards ) |
| 111 | + |
| 98 112 | ``` |
| 99 | - # Make sure you have Docker and Docker Compose running on your machine |
| 113 | + # Get help |
| 114 | + $ make help |
| 100 115 | |
| 101 116 | # Start the MQTT servers (better to start separately to warm them up) |
| 102 | - $ make start-servers |
| 117 | + $ make start |
| 103 118 | |
| 104 119 | # Run tests |
| 105 120 | $ make test |
| @@ -107,12 +122,3 @@ $ make test | |
| 107 122 | # Stop and cleanup docker instances etc. |
| 108 123 | # make stop |
| 109 124 | ``` |
| 110 | - |
| 111 | - ## Changelog |
| 112 | - |
| 113 | - Please check the [CHANGELOG.md](https://github.com/suvash/hulaaki/blob/master/CHANGELOG.md). |
| 114 | - |
| 115 | - ## Naming |
| 116 | - |
| 117 | - Hulaaki(pronouced as who-laa-key) is the phonetic spelling of the word |
| 118 | - हुलाकी in Nepali, which translates to Postman in English. |
| @@ -13,4 +13,4 @@ | |
| 13 13 | {<<"maintainers">>,[<<"Suvash Thapaliya">>]}. |
| 14 14 | {<<"name">>,<<"hulaaki">>}. |
| 15 15 | {<<"requirements">>,[]}. |
| 16 | - {<<"version">>,<<"0.1.0">>}. |
| 16 | + {<<"version">>,<<"0.1.1">>}. |
| @@ -56,6 +56,10 @@ defmodule Hulaaki.Client do | |
| 56 56 | end |
| 57 57 | |
| 58 58 | def handle_call(:stop, _from, state) do |
| 59 | + conn_pid = state.connection |
| 60 | + if conn_pid && Process.alive?(conn_pid) do |
| 61 | + Connection.stop(conn_pid) |
| 62 | + end |
| 59 63 | {:stop, :normal, :ok, state} |
| 60 64 | end |
| @@ -1,7 +1,7 @@ | |
| 1 1 | defmodule Hulaaki.Mixfile do |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 | - @version "0.1.0" |
| 4 | + @version "0.1.1" |
| 5 5 | |
| 6 6 | def project do |
| 7 7 | [app: :hulaaki, |
| @@ -46,7 +46,9 @@ defmodule Hulaaki.Mixfile do | |
| 46 46 | end |
| 47 47 | |
| 48 48 | defp docs do |
| 49 | - [source_ref: "v#{@version}", main: "readme", readme: "readme.md", |
| 49 | + [main: "readme", |
| 50 | + extras: [ "README.md" ], |
| 51 | + source_ref: "v#{@version}", |
| 50 52 | source_url: "https://github.com/suvash/hulaaki"] |
| 51 53 | end |
| 52 54 | end |