Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/adamkittelson/block_timer

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/adamkittelson/block_timer

  • v0.0.0-20141101172119-2730d39680d4
  • Source
  • Go
  • Socket score

Version published
Created
Source

Build Status

BlockTimer

Macros to use :timer.apply_after and :timer.apply_interval with a block, e.g.:

  iex(1)> import BlockTimer
  nil
  iex(2)> apply_after 3 |> seconds, do: IO.puts "hello"
  {:ok, {1407446427626194, #Reference<0.0.0.371>}}
  iex(3)> hello
  iex(1)> import BlockTimer
  nil
  iex(2)> {:ok, counter} = Agent.start_link fn -> 0 end
  {:ok, #PID<0.70.0>}
  iex(3)> {:ok, tref} = apply_interval 1 |> seconds do
  ...(3)> Agent.update(counter, fn(count) -> count + 1 end)
  ...(3)> IO.puts Agent.get(counter, fn(count) -> count end)
  ...(3)> end
  {:ok, {:interval, #Reference<0.0.0.382>}}
  iex(4)> 1
  2
  3
  4
  5
  :timer.cancel tref
  {:ok, :cancel}
  iex(5)>

FAQs

Package last updated on 01 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc