scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
-module(dstore). | |
% internal operations | |
-export([init/0, loop/1, write/3]). | |
% public system operations | |
-export([start_link/0, stop/0, sync/2, replicate/1, pid/0]). | |
% public k/v operations | |
-export([lookup/1, write/2]). | |
-define(TIMEOUT, 30000). |
Inspired by Stuff Goes Bad - Erlang in Anger
Is the global process count indicative of a leak? If so, you may need to investigate unlinked processes, or peek inside supervisors’ children lists to see what may be weird-looking.
defmodule Diags do
@doc """
defmodule ExCluster.StateHandoff do | |
use GenServer | |
require Logger | |
def start_link(opts) do | |
GenServer.start_link(__MODULE__, opts, name: __MODULE__) | |
end | |
def child_spec(opts \\ []) do | |
%{ |
defmodule MyApp do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |
defmodule Cluster.RabbitStrategy do | |
use GenServer | |
use Cluster.Strategy | |
import Cluster.Logger | |
alias Cluster.Strategy.State | |
@routing_key "cluster.heartbeat" | |
def start_link(opts) do |
defmodule RepoStream do | |
defmodule Producer do | |
use GenStage | |
defstruct [:demand, :pid] | |
def start_link() do | |
GenStage.start_link(__MODULE__, self()) | |
end |
Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app:
# RollbackAttributes should also rollback relationships | |
# Based on http://stackoverflow.com/a/27184207/223225 and https://github.com/emberjs/rfcs/pull/21#issuecomment-135134132 | |
DS.Model.reopen | |
rollbackAttributes: -> | |
@_super() | |
@rollbackRelationships() | |
cacheOriginalRelations: -> |
-module(gproc_tests). | |
-compile(export_all). | |
-include_lib("stdlib/include/qlc.hrl"). | |
go() -> make:all([load]). | |
register_stuff() -> | |
gproc:reg({n, l, key1}, value1), | |
gproc:reg({n, l, key2}, value2), | |
gproc:reg({n, l, key3}, value3), |