Async

Attribute that marks a function as asynchronous. It means that the response is not sent to the client when the method returns but when the send function is called in the response. This attribute should be used when the route's method permorms an asynchrous action such as a client http call or using the database.

Members

Functions

test
bool test(Context context)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

@Async
@Get
getAsync(Response response) {
   new Client().connect("example.com").get("/").success((ClientResponse cresponse){
      response.body = cresponse.body;
      response.send();
   });
}

Meta