Skip to content

Instantly share code, notes, and snippets.

@ayrat555
Created September 22, 2018 20:01
Show Gist options
  • Save ayrat555/91ffdb05f491f45a7caa50708e85dfe8 to your computer and use it in GitHub Desktop.
Save ayrat555/91ffdb05f491f45a7caa50708e85dfe8 to your computer and use it in GitHub Desktop.
defmodule QuotesBot do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
worker(QuotesBot.Polling.Server, []),
:poolboy.child_spec(:worker, poolboy_config())
]
opts = [strategy: :one_for_one, name: QuotesBot.Supervisor]
Supervisor.start_link(children, opts)
end
defp poolboy_config do
[
{:name, {:local, :worker}},
{:worker_module, QuotesBot.Bot.Server},
{:size, 20},
{:max_overflow, 5}
]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment