Start a new topic

Callbacks in custom endpoints

What is the best way to ensure that a callback passed to a method on a collection within a custom endpoint completes before the endpoint returns? Is there a way to block until the callbacks are called?
1 Comment

The best way is to use the async module to manage your code. You have to be careful that within each collection access callback, you call the defined async callback. Then, in the final callback of the async method, you call response.complete or response.continue.
Login or Signup to post a comment