Thanks to visit codestin.com
Credit goes to github.com

Skip to content

lpil/repeatedly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repeatedly

Call a function repeatedly with a delay between each call.

Package Version Hex Docs

Works on both Erlang and JavaScript runtimes! This means it's good for little scripts, but if you're writing a full OTP program then this isn't the right library to use, and something that exposes OTP compatible APIs would be better.

gleam add repeatedly
import repeatedly

pub fn main() {
  // Print every 500ms
  let repeater = repeatedly.call(500, Nil, fn(_state, i) {
    io.println("Call number " <> int.to_string(i))
  })

  // And at some point later, stop it
  repeatedly.stop(repeater)
}

Further documentation can be found at https://hexdocs.pm/repeatedly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •