Skip to content

Instantly share code, notes, and snippets.

Avatar
💧
elixiring

nico piderman sneako

💧
elixiring
  • AppMonet
  • Barcelona, ES
View GitHub Profile
@sneako
sneako / writer.ex
Last active Mar 19, 2019
Kinesis Writer
View writer.ex
defmodule KinesisWriter.Writer do
@type t :: %__MODULE__{
aggregator: ExKpl.t(),
client: module(),
client_opts: Keyword.t()
}
defstruct aggregator: ExKpl.new(),
client: KinesisWriter.Client,
client_opts: []
@sneako
sneako / worker.ex
Last active Mar 19, 2019
Kinesis GenServer
View worker.ex
defmodule KinesisServer.Worker do
use GenServer
alias KinesisServer.Writer
def start_link(opts \\ []) do
GenServer.start_link(__MODULE__, Writer.new(opts))
end
@impl true
def init(init_arg) do
@sneako
sneako / application.ex
Last active Mar 19, 2019
Kinesis Pool
View application.ex
defmodule KinesisWriter do
use Application
def start(_type, _args) do
children = [
:poolboy.child_spec(
:kinesis_writer_pool,
[
name: {:local, :kinesis_writer_pool},
worker_module: KinesisWriter.Worker,