Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Add information to README
Browse files Browse the repository at this point in the history
  • Loading branch information
suvash committed Apr 19, 2015
1 parent c5a7220 commit f397fcd
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 5 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Suvash Thapaliya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
75 changes: 70 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,80 @@
[![Build Status](https://travis-ci.org/suvash/hulaaki.svg?branch=master)](https://travis-ci.org/suvash/hulaaki?branch=master)
[![Coverage Status](https://coveralls.io/repos/suvash/hulaaki/badge.svg?branch=master)](https://coveralls.io/r/suvash/hulaaki?branch=master)
[![Inline docs](http://inch-ci.org/github/suvash/hulaaki.svg?branch=master)](http://inch-ci.org/github/suvash/hulaaki?branch=master)
[![Gitter](https://badges.gitter.im/chat.svg)](https://gitter.im/suvash/hulaaki)

Pronouced as who-laa-key.
Hulaaki is a client library for MQTT 3.1.1 entirely written in Elixir.

## Usage

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

In the works.
Add Hulaaki to your project dependencies in `mix.exs`

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.

# Usage
Add the following sample client to your project.

Do not use. YET.
```elixir
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_pong(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", host: "localhost", port: 1883]
> SampleClient.connect(pid, options)
> SampleClient.ping(pid)
```

Once you get the idea, feel free to check the inline documentation and
[client_test.exs](test/hulaaki/client_test.exs) for more example usage
and test strategy.

## Documentation

Please refer to the inline documentation and tests to explore the
documentation for now. This shall be improved over time.

## Immediate TODOs
* Pingpong based heartbeat in Client based on the timeout.
* .....

## Contributing

Pull requests with appropriate tests and improvements are welcome.

## Naming

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

0 comments on commit f397fcd

Please sign in to comment.