Sorcery.Killbot (sorcery v0.4.4)

This is a garbage collector, of sorts.

Every time it runs, it will scan SorceryDb for all dead pids and hang onto those until the postmortem_delay is over For every pid in which the delay IS over, it will find the entities in their portals, filter out any entities that are being watched in other portals, and then remove them from :mnesia.

defmodule MyApp.Sorcery do
  use Sorcery,
    killbot: %{
      # Defaults to 10 minutes
      interval: 10 * 60 * 1_000, 

      # Wait 2 intervals AFTER the pid dies, before wiping the entities       
      # It is likely a user will close a page and come back a few minutes later...
      # So we don't want to uncache things too quickly.
      #
      # Again, I stress that this is NOT milliseconds, but the number of intervals.
      postmortem_delay: 2        
    }
end

Summary

Functions

Returns a specification to start this module under a supervisor.

Return all the dead portals being watched, which have not yet been removed.

Start a run immediately. This does speed up the postmortem_delay

Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Return all the dead portals being watched, which have not yet been removed.

Start a run immediately. This does speed up the postmortem_delay