Steemex v0.9 released: operation streaming and support for market, follows, accounts and witnesses API methods
I've just released a large update to Steemex, an open source websockets Steem client library for Elixir/Erlang.
Changelog
Steemex.Streamer
provides a simple and convenient subscription interface to the stream of new Steem blockchain operations- streaming handler example module
- functions for witnesses database API methods
- functions for accounts database API methods
- functions for market API methods
- functions for follows API methods
- Modules and structs are implemented for most types of operations
- docs and typespecs for all database API
Repos and docs
Steemex is used for data collection on Steempunks.
Example of an operation stream handler module
defmodule Steemex.OpsHandlerExample do
use GenServer
require Logger
@doc"""
Starts the handler module
"""
def start_link do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
def init(config \\ %{}) do
{:ok, config}
end
def handle_info({:comment, data}, state) do
Logger.info("New post or comment: #{inspect(data)}" )
{:noreply, state}
end
def handle_info({:vote, data}, state) do
Logger.info("New vote: #{inspect(data)}" )
{:noreply, state}
end
def handle_info({op_type, op_data}, state) do
Logger.info("New operation #{op_type}: #{inspect(op_data)}" )
{:noreply, state}
end
end
Roadmap
- Investigate using GenStage
- Add more utility functions
- Add more types and structs
- Add transaction broadcast
About Elixir
Elixir is a functional programming language with superior concurrency primitives, distributed computation and fault tolerance capabilities based on Erlang/OTP.
Personally, I am really happy with my bet on Elixir to build cryptotokens related apps and strongly recommend every developer to try it.
Learning resources:
- ElixirConf Jose Valim Keynote
- ElixirConf 2016 Chris McCord Keynote
- Elixir School
- Elixir Crash Course
Congratulation @ontofractal. looking forward to see what can we build on steem with Elixir
Good job,
I'm trying to kickstart the use of a new tag #steemdev , Your post would fit well that tag.
https://steemit.com/active/steemdev