Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

factor out use of setTimeout

  • Loading branch information...
commit aaaf51479e0b95999674c7a8403298450a4bb4b3 1 parent 1f7e8bd
@mental authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/Actor.coffee
View
7 src/Actor.coffee
@@ -3,6 +3,9 @@ WebActors = if require? and exports?
else
@WebActors ?= {}
+nextTick = (cb) ->
+ setTimeout(cb, 0)
+
class NullActor
constructor: ->
@actor_id = null
@@ -61,7 +64,7 @@ class LocalActor
cont = receiver(message)
if cont
@receivers = []
- setTimeout(@wrap_cont(cont), 0)
+ nextTick(@wrap_cont(cont))
return true
return false
@@ -98,7 +101,7 @@ class LocalActor
start: (body) ->
register_actor @actor_id, this
- setTimeout(@wrap_cont(body), 0)
+ nextTick(@wrap_cont(body))
shutdown: (reason) ->
@killed = true

0 comments on commit aaaf514

Please sign in to comment.
Something went wrong with that request. Please try again.