Skip to content

Instantly share code, notes, and snippets.

View zxq9's full-sized avatar

Craig Everett zxq9

View GitHub Profile

Keybase proof

I hereby claim:

  • I am zxq9 on github.
  • I am zxq9 (https://keybase.io/zxq9) on keybase.
  • I have a public key ASCRODrhthVRMDDrBMd8YTEHwW_AexVDxuk2J9UpN2riOgo

To claim this, I am signing this object:

@zxq9
zxq9 / pipe.erl
Created September 6, 2018 10:13
Simple pipelines
-spec pipe([Fun], Value) -> Result
when Fun :: fun((Value) -> Result),
Value :: term(),
Result :: {ok, NewValue}
| {error, Reason}
| {error, Reason, Info},
NewValue :: term(),
Reason :: term(),
Info :: {Fun, Value}
| {Fun, Value, Info}.
1> tail_vs_direct:run_double_direct(1000000).
% ...
<0.250.0> double_direct Pass# 999900
{total_heap_size,16926904}
{heap_size,12834421}
{memory,135416080}
{stack_size,3999614}
{reductions,17868909}
System memory: 12344328
Total runtime memory: 216423592
-module(ertorrent_torrent_ssup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
start_link() ->
supervisor:start_link(ertorrent_torrent_ssup, []).
init(_Arg) ->
RestartStrategy = {one_for_one, 4, 5},
ServiceSup = #{id => ertorrent_torrent_sup,