# `CredoHotUpgrades.Check.LocalReceiveLoop`
[🔗](https://github.com/deployex/credo_hot_upgrades/blob/main/lib/credo_hot_upgrades/check/local_receive_loop.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `high` and works with any version of Elixir.

## Explanation

The VM keeps two versions of a module, the current one and the old one,
and a process executing old code stays there until it makes a fully
qualified call. A process that loops by calling its own function without
the module name stays on the version it started on forever:

    defp loop(state) do
      receive do
        msg -> loop(handle(msg, state))   # never leaves the old code
      end
    end

The old code does not stay for long, it is purged when the release is
made permanent, and any process still running it is killed, blocking the
next deploy. Call `__MODULE__.loop(...)` instead. A `GenServer` is fine,
its loop belongs to the library.

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
