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 QueueGenserver do | |
use GenServer | |
@moduledoc """ | |
Documentation for ProducerConsumerGenserver. | |
""" | |
def start_link(producers \\ 120, consumers \\ 120, size \\ 10) do | |
GenServer.start_link(__MODULE__, {[], size}) | |
for id <- 1..producers, do: ProducerGenserver.start_link(id, self()) | |
for id <- 1..consumers, do: ConsumerGenserver.start_link(id, self()) |
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
call plug#begin() | |
Plug 'junegunn/vim-easy-align' | |
Plug 'tpope/vim-sensible' | |
Plug 'tpope/vim-fugitive' | |
Plug 'tpope/vim-rails' | |
Plug 'tpope/vim-rake' | |
Plug 'tpope/vim-haml' | |
Plug 'vim-ruby/vim-ruby' | |
Plug 'flazz/vim-colorschemes' |
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 Languafy.Web.Context do | |
@behaviour Plug | |
import Plug.Conn | |
alias Languafy.User | |
def init(opts), do: opts | |
def call(conn, _) do | |
case build_context(conn) do | |
{:ok, context} -> |