get()blocking operation, but that is an over simplistic approach to async programming because you are ultimately blocking to get the result.
CompletableFutureAPI, so the majority of things will apply as well; even Java developers will feel at home. It will allow you to create rich pipelines for creating multiple Futures, chaining, composing and combining results.
coldbox-tasksfixed executor (20 threads - IO bound) that is used internally for cleanups, tasks, and schedules. However, any module or application can leverage it for scheduling tasks or workers.
coldbox-tasksschedule task executor.
ModuleServiceand all internal ColdBox services have deeper logging constructs and more information logging to understand what happens inside of the core.
developmentcustom error template.
coldbox.system.RestHandlerwhich you can inherit from or use our new
restHandlerannotation. This will give you access to our enhanced API utilities and the native response object via the request context's
aroundHandler() provided in the
RestHandlerwill intercept all rest calls in order to provide consistency and uniformity to all your actions. It will try/catch for major known exceptions, time your requests, add extra output on development and much more. Here are a list of the features available to you:
InvalidCredentials, ValidationException, EntityNotFound, RecordNotFound
developmentenvironment it will respond with much more information necessary for debugging both in the response object and headers
developmentenvironment it will set the following headers for you:
x-response-time: The time the request took in CF
x-cached-response: If the request is cached via event caching
aroundHandler()is also smart in detecting the following outputs from a handler:
prc.responseobject, if the object doesn’t exist, it will create it and set it for you
RestHandlerthen you will have to create your own base handler that inherits from it. Then all of your concrete handlers will inherit from your very own handler.
coldbox.system.web.context.Responseand the rest handler constructs it by calling the request context’s
getResponse() method. The method verifies if there is a
prc.responseobject and if it exists it returns it, else it creates a new one. So if you would like to use your very own, then just make sure that before the request you place your own response object in the
preProcess()interceptor. Create a simple interceptor with commandbox e.g
prcscope, ColdBox will utilize it. Just make sure that your custom Response object satisfies the methods in the core one. If you want to modify the output of the response object a good place to do that would be in the
getDataPacket()method of your own
MyResponseObject. Just make sure this method will return a
when()method that will allow you to build functional statements within your handlers. Here is the signature of this functional helper:
targetis a boolean and can be an expression that evaluates to a boolean. If the
targetis true, then the
successclosure will be executed for you, if not, the
failureclosure will be executed.
renderView()calls, your applications will fly now!
fwReinit. This is useful for security purposes.
announce()method. We have also deprecated the argument
interceptDatain favor of just
listen()method to register one-off closures
listen()method which accepts a closure/udf so you can listen to ColdBox interceptions. Here is the method signature:
buildLink()Ease of Use
buildLink()Named Route Support
event.buildLink()has been now added named route support. The
event.route()method was introduced to do named routing with a
paramsargument. Now, you can also use this approach but via the
toargument in the
buildLink()method by just passing a struct.
meta()method or the
metaargument. This is simply a struct of name value pairs you can add into the route record.
getCurrentRouteRecord()to the request context so you can get the struct definition of the route record of the currently routed route. Below is a sample screenshot of the record:
toRedirect()method has been enhanced to accept a closure as the
targetof relocation. This closure will received the parsed parameters, the incoming route record and the event object. You can now determine dynamically where the relocation will go.