Add deprecation notice
Do not use this client. It has been deprecated. Use the nats.ex elixir client instead.
Elixir style documentation is located here
The framework requires Elixir 1.2.2 or above. To use it in your project, add the following to your mix.exs:
mix.exs
defp deps do # for github [{:nats, git: "https://github.com/nats-io/elixir-nats.git"}] # for hex (forthcoming) [{:natsio, "~> 0.1.6"}] end
Run the test servers:
./test/run-test-servers.sh
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:
Client.start_link
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:
config/config.exs
use Mix.Config # debug will log most everything # info prints connection lifecycle events # error prints errors config :logger, level: :debug
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
Bump version in mix.exs:
... @version "0.1.6" ...
As an administrator in the natsio hex package:
mix hex.publish
License
Copyright 2016 Apcera Inc. All rights reserved.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
(Deprecated) An Elixir framework for NATS
Deprecated
Original Content
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:To build and/or test from sources
Run the test servers:
Clone, fork or pull this repository. And then:
To run the examples:
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:The framework leverages the standard logger, by default only errors are logged. To view additional logging, update your
config/config.exs: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:
Release Library
Bump version in
mix.exs:As an administrator in the natsio hex package:
License
License
Copyright 2016 Apcera Inc. All rights reserved.