Skip to content

server time

Emiel Mols edited this page Aug 12, 2015 · 1 revision

Schedules an onTimer event at a later time.

exports.client_doLater = !->
	Timer = require 'timer'
	Timer.set 15000, 'onMyTimer', {bla: "my argument"}

exports.onMyTimer = (arg) !->
	log "A new message awaits!"

Functions

set(timeMs, name="onTimer", arg?)

Create a timer. When the timer is due, exports[name] will be called with arg as its argument (or plural arguments, in case arg is an array).

cancel(name,arg?)

Cancels a previously set timer. Both name and arg should match, unless arg is an array, in which case the array can be partial and will be prefix matched.

Basic topics

API reference

  • API Reference
    • Client
      • [client plugin](client plugin)
      • [client dom](client dom)
      • [client obs](client obs)
      • [client db](client db)
      • [client server](client server)
      • [client page](client page)
      • [client ui](client ui)
      • [client form](client form)
      • [client icon](client icon)
      • [client modal](client modal)
      • [client photo](client photo)
      • [client photoview](client photoview)
      • [client time](client time)
      • [client share](client share)
      • [client map](client map)
      • [client geoloc](client geoloc)
    • Server
      • [server event](server event)
      • [server plugin](server plugin)
      • [server http](server http)
      • [server db](server db)
      • [server photo](server photo)
      • [server time](server time)
  • Example UI elements

Advanced topics

Clone this wiki locally