GithubHelp home page GithubHelp logo

mceaglens / elixir-nats Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nats-io/elixir-nats

0.0 0.0 0.0 256 KB

Elixir NATS client

License: MIT License

Elixir 52.64% Shell 1.61% Erlang 45.75%

elixir-nats's Introduction

An Elixir framework for NATS

Build Status Coverage Status

Elixir style documentation is located here

Getting Started

The framework requires Elixir 1.2.2 or above. To use it in your project, add the following to your mix.exs:

defp deps do
    # for github
    [{:nats, git: "https://github.com/nats-io/elixir-nats.git"}]
    # for hex (forthcoming)
    [{:natsio, "~> 0.1.5"}]
end

To build and/or test from sources

Clone, fork or pull this repository. And then:

$ mix deps.get
$ mix compile
$ mix test

To run the examples:

$ mix run examples/sub.exs
$ mix run examples/pub.exs

The default NATS configuration looks for a gnatsd instance running on the default port of 4222 on 127.0.0.1.

You can override the configuration by passing a map to Client.start_link. For example:

  alias Nats.Client
  
  nats_conf = %{host: "some-host", port: 3222,
                tls_required: true,
                auth: %{ user: "some-user", pass: "some-pass"}}
  {:ok, ref} = Client.start_link(nats_conf)
  Client.pub(ref, "subject", "hello NATS world!")

The framework leverages the standard logger, by default only errors are logged. To view additional logging, update your config/config.exs:

use Mix.Config

# debug will log most everything
# info prints connection lifecycle events
# error prints errors
config :logger, level: :debug

Status

Most NATS related capabilities are in place: publishing, subscribing, tls, authorization.

Elixir Application, supervisor/monitor and environment support needs improved

Documentation is minimal. For now:

$ mix docs
$ open docs/index.html
$ cat examples/*.exs

License

License

Copyright 2016 Apcera Inc. All rights reserved.

elixir-nats's People

Contributors

camros avatar mindreframer avatar aforward avatar derekcollison avatar leifg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.