- Announcing GenStage http://elixir-lang.org/blog/2016/07/14/announcing-genstage/
https://gist.github.com/colinbankier/a3f2eb7642b94c0d610a
Elixir in Action, by Sasa Juric
defmodule Elchemy.LocalDeps do | |
def find!(dir), do: find!([], dir) | |
def find!(dirs, dir) do | |
files = dir |> File.ls! | |
if Enum.member?(files, "mix.exs") do | |
[dir | dirs] | |
else | |
files | |
|> Enum.map(&Path.join(dir, &1)) | |
|> Enum.filter(&File.dir?/1) |
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0,allocate/0,deallocate/1,stop/0, client/1, supervisor_start/0]). |
%% Based on code from | |
%% Erlang Programming | |
%% Francecso Cesarini and Simon Thompson | |
%% O'Reilly, 2008 | |
%% http://oreilly.com/catalog/9780596518189/ | |
%% http://www.erlangprogramming.org/ | |
%% (c) Francesco Cesarini and Simon Thompson | |
-module(frequency). | |
-export([start/0, init/0, allocate/0, deallocate/1]). |
-module(index). | |
-export([get_index/1]). | |
% Used to read a file into a list of lines. | |
% Example files available in: | |
% gettysburg-address.txt (short) | |
% dickens-christmas.txt (long) | |
% Get the contents of a text file into a list of lines. |
https://gist.github.com/colinbankier/a3f2eb7642b94c0d610a
Elixir in Action, by Sasa Juric
In Elixir, all code runs inside processes. Processes are isolated from each other, run concurrent to one another and communicate via message passing. Processes are not only the basis for concurrency in Elixir, but they also provide the means for building distributed and fault-tolerant programs.
Elixir’s processes should not be confused with operating system processes. Processes in Elixir are extremely lightweight in terms of memory and CPU (unlike threads in many other programming languages). Because of this, it is not uncommon to have tens or even hundreds of thousands of processes running simultaneously.
The most basic mechanism for creating processes is using the spawn/1
function:
July 23, 2015
Welcome newcomers!
Last meetup Mark walked us through creating a RESTful database application in Phoenix, from scratch. We played with the HTML and JSON generators that ship with Phoenix to create a simple CRUD app. We want to keep building