1. Kenneth Jørgensen
  2. calamity

Commits

Kenneth Jørgensen  committed c014d1b

Disabled deferred execution as an experiment

  • Participants
  • Parent commits a044547
  • Branches default
  • Tags 0.5.0-rc.5

Comments (0)

Files changed (3)

File CHANGELOG.md

View file
 ## 0.5.0 (dev)
 * *API change:* Replies now send a new `EventMessage` object instead of plain object.
 * *API change:* Changed the way `EventMessage.replyError` serializes the error object to something more meaningful.
+* *API change:* Changed events to fire synchronously as an experiment. Asynchronous handling seems to cause more trouble that it's worth.
 * *Feature:* Implemented `replyError()` on `EventMessage` to allow for easy handling of errors.
 * *Feature:* Implemented `toJSON()`  and `fromJSON()` on `EventMessage`.
 * *Feature:* Implemented `getRequired()`  and `getOptional()` on `EventMessage` for data retrieval.

File src/core/EventMessage.coffee

View file
 		unless data instanceof EventMessage
 			data = new EventMessage null, data, replier
 		# Execute.
-		_.defer ->
-			replyHandler data
-			return
+		replyHandler data
+#		_.defer ->
+#			replyHandler data
+#			return
 		return @
 
 	# ## `replyError()`

File src/core/Subscription.coffee

View file
 		# Bind handler.
 		bound = _.bind @handler, @context
 		# Execute.
-		_.defer ->
-			bound msg
-			return
+		bound msg
+#		_.defer ->
+#			bound msg
+#			return
 
 		return @