get()
blocking operation, but that is an over simplistic approach to async programming because you are ultimately blocking to get the result.CompletableFuture
API, 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-tasks
Global Executorcoldbox-tasks
fixed 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-tasks
schedule task executor.cachebox-tasks
.ModuleService
and all internal ColdBox services have deeper logging constructs and more information logging to understand what happens inside of the core.development
custom error template.development
method.coldbox.exceptionEditor
setting:vscode
(Default)vscode-insiders
sublime
textmate
emacs
macvim
idea
atom
espresso
coldbox.system.RestHandler
which you can inherit from or use our new restHandler
annotation. This will give you access to our enhanced API utilities and the native response object via the request context's getResponse()
method.aroundHandler
() provided in the RestHandler
will 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
development
environment it will respond with much more information necessary for debugging both in the response object and headersdevelopment
environment it will set the following headers for you:x-current-route
x-current-routed-url
x-current-routed-namespace
x-current-event
x-response-time
: The time the request took in CFx-cached-response
: If the request is cached via event cachingaroundHandler()
is also smart in detecting the following outputs from a handler:return
resultsrenderData()
callsgetResponse()
prc.response
object, if the object doesn’t exist, it will create it and set it for youcoldbox.system.web.context.Response
RestHandler
then 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.Response
and the rest handler constructs it by calling the request context’s getResponse
() method. The method verifies if there is a prc.response
object 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 prc
scope.preProcess()
interceptor. Create a simple interceptor with commandbox e.gconfig/Coldbox.cfc:
prc
scope, 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 struct
.when()
when()
method that will allow you to build functional statements within your handlers. Here is the signature of this functional helper:target
is a boolean and can be an expression that evaluates to a boolean. If the target
is true, then the success
closure will be executed for you, if not, the failure
closure will be executed.renderView()
calls, your applications will fly now!fwReinit
. This is useful for security purposes.http://localhost/index.cfm?cbReinit=true
announce()
method. We have also deprecated the argument interceptData
in favor of just data.
listen()
method to register one-off closureslisten()
method which accepts a closure/udf so you can listen to ColdBox interceptions. Here is the method signature:onColdBoxShutdown()
buildLink()
Ease of UsebuildLink()
Named Route Supportevent.buildLink()
has been now added named route support. The event.route()
method was introduced to do named routing with a name
and params
argument. Now, you can also use this approach but via the to
argument in the buildLink()
method by just passing a struct.meta()
method or the meta
argument. This is simply a struct of name value pairs you can add into the route record.getCurrentRouteMeta()
method: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 target
of 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.