Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 57 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,57 @@
on: push

env:
ELIXIR_ERL_OPTIONS: -kernel prevent_overlapping_partitions false

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
elixir-version: [1.15, 1.14, 1.13]
otp-version: [26, 25, 24]
exclude:
- elixir-version: 1.13
otp-version: 26

name: Tests
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}

- run: mix deps.get

- run: mix compile --warnings-as-errors
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix format --check-formatted
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix test
on: push

env:
ELIXIR_ERL_OPTIONS: -kernel prevent_overlapping_partitions false

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
elixir-version: [1.15, 1.14, 1.13]
otp-version: [26, 25, 24]
exclude:
- elixir-version: 1.13
otp-version: 26

name: Tests
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}

- run: mix deps.get

- run: mix compile --warnings-as-errors
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix format --check-formatted
if: matrix.elixir-version == 1.15 && matrix.otp-version == 26

- run: mix test

dialyzer:
runs-on: ubuntu-latest
name: Dialyzer
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
elixir-version: 1.15
otp-version: 26

- name: Restore PLT cache
uses: actions/cache@v3
with:
path: priv/plts
key: plt-${{ runner.os }}-1.15-26-${{ hashFiles('mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-1.15-26-

- run: mkdir -p priv/plts
- run: mix deps.get
- run: mix dialyzer --plt
- run: mix dialyzer
65 changes: 34 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
horde-*.tar

.elixir_ls

*.beam

.tool-versions

*.app
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
horde-*.tar

.elixir_ls

*.beam

.tool-versions

*.app

# Dialyzer PLT files
/priv/plts/
8 changes: 4 additions & 4 deletions lib/horde/distribution_strategy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ defmodule Horde.DistributionStrategy do

@moduledoc """
Define your own distribution strategy by implementing this behaviour and configuring Horde to use it.

A few distribution strategies are included in Horde, namely:

- `Horde.UniformDistribution`
- `Horde.UniformQuorumDistribution`
- `Horde.UniformRandomDistribution`
Expand All @@ -15,6 +15,6 @@ defmodule Horde.DistributionStrategy do
spec :: Supervisor.child_spec(),
members :: [member()]
) ::
{:ok, member()} | {:error, reason :: String.t()}
@callback has_quorum?(members :: [member()]) :: boolean()
{:ok, member()} | {:error, reason :: atom()}
@callback has_quorum?(members :: [member()]) :: boolean() | nil
end
2 changes: 1 addition & 1 deletion lib/horde/dynamic_supervisor_impl.ex
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ defmodule Horde.DynamicSupervisorImpl do
{:noreply, state}
end

def handle_cast({:untrack_child_process, child_id}, state) do
def handle_cast({:release_child_process, child_id}, state) do
{value, new_processes_by_id} = pop_item(state.processes_by_id, child_id)

new_state =
Expand Down
Loading