Skip to content

A periodically task runner. The runner wait to the former task to end before it runs the new one.

Notifications You must be signed in to change notification settings

annatel/periodic_task_runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PeriodicTaskRunner

A periodically task runner. The runner wait to the former task to end before it runs the new one.

Installation

def deps do
  [
    {:periodic_task_runner, git: "git@github.com:periodic_task_runner.git", tag: "0.1.0"}
  ]
end

How to use

iex> task = fn -> IO.inspect("YouCanDoIt") end
iex> one_minute_in_ms = 60_000
iex> {:ok, _pid} = PeriodicTaskRunner.start_task("self_motivation", task, one_minute_in_ms)
# After one minute
iex> "YouCanDoIt"
# After one minute
iex> "YouCanDoIt"
# After one minute
iex> "YouCanDoIt"
# After one minute
iex> "YouCanDoIt"
# After one minute
iex> "YouCanDoIt"
iex> true = PeriodicTaskRunner.task_exists?("self_motivation")
iex> :ok = PeriodicTaskRunner.stop_task("self_motivation")

About

A periodically task runner. The runner wait to the former task to end before it runs the new one.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages