Skip to content

chrisgreg/timebomb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

efb176d · May 21, 2021

History

10 Commits
May 21, 2021
May 14, 2021
May 14, 2021
May 14, 2021
May 21, 2021
May 14, 2021
May 14, 2021

Repository files navigation

Timebomb

ETS backed delayed action scheduler written in Elixir & Erlang.

Ever wanted to implement something like how UberEats and Deliveroo ping you with a notification if you don't checkout after X time?

Installation

If available in Hex, the package can be installed by adding timebomb to your list of dependencies in mix.exs:

def deps do
  [
    {:timebomb, "~> 0.1.0"}
  ]
end

Example Usage

Sparking a fuse on an action

Timebomb.start_link
{:ok, #PID<0.200.0>}

Timebomb.spark(fuse: 10_000, bomb: 1+5)
  
...10 seconds later

6

Stopping a payload from firing

Timebomb.start_link
{:ok, #PID<0.200.0>}

id = Timebomb.spark(fuse: 10_000, bomb: 1+5)
"53b45c7f-8bde-4d24-ae99-a6f215bb7104"

Timebomb.disarm(id)
Payload disarmed
:ok

TODO:

  • Tests
  • Publish on Hex

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/timebomb.

About

ETS backed delayed action scheduler for Elixir

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages