Created
September 22, 2018 20:01
-
-
Save ayrat555/91ffdb05f491f45a7caa50708e85dfe8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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