Skip to content

0.4.0 - Interface overhaul

Compare
Choose a tag to compare
@ohpauleez ohpauleez released this 17 Apr 20:17
· 1209 commits to master since this release

Moving forward from the 0.3.x releases, this release simplifies Pedestal's APIs, enhances performance significantly, adds new cutting-edge capabilities to handle errors, fixes a number of small bugs, and updates all of the samples.

Unlike previous releases, each major change was fairly well documented in Pull-Requests.

Changes

Prefix-tree router and open routing

Pedestal's previous router performed a linear scan across a sequence of maps to find a matching handler. In this release, the default router is now a prefix-tree based one, that is extremely efficient in terms of time and space. Additionally, we've opened up the router core of Pedestal, allowing developers to use the :prefix-tree, :linear-scan, or their own router (passed as a function that takes a single argument, the route table). Details can be found in the router pull-request

New error-handler

In any sophisticated Pedestal service, one must handle :errors at various points throughout the interceptor chain. It becomes increasingly difficult to keep the error handling coherent as the system grows - sometimes you're handling errors from handlers/business logic, other times you're handling errors from processing that occurs within the interceptor chain itself. Async operations only further exacerbate things.
With this release comes a new error-handler interceptor that will pattern match on exceptions throughout your entire interceptor chain. This allows developers to consolidate error handling, while providing stronger capabilities to target errors precisely. The design is largely inspired by the X10 parallel programming language. Details and instructions can be found in the error-handler pull request

Overhauled Interceptor API

The previous API for creating interceptors had a rather large surface area. While those functions and macros all served a purpose, many people wanted something smaller at the core. A new interceptor API was designed around a protocol that embodied the common interceptor-creation cases. This change also allowed interceptor creation to be open for extension. Details and instructions can be found in the interceptor API pull-request

Documentation updates

All of the samples have been updated to a much more recent version of Pedestal

Breaking changes and migration

This release has two major breaking changes. Please see the Pull-Requests for specific details.

  1. The Interceptor API is different, and the previous functions and macros have been moved into a new namespace. You will need to patch up your namespaces.
  2. The default router is now the tree-based router. Certain routing capabilities will no longer work. That said, you can always use the :linear-search router, if you need those capabilities.

Upcoming work

  • Request optimizations - we're still working hard to figure out the best data structure for minimizing allocations per request
  • Servlet-less Pedestal - we have a design for removing the Servlet-specific pieces of Pedestal. This would allow Pedestal to work on top of other servers, in other contexts, and enable us to unlock more performance per container/platform. We would still have support for running a Servlet-enabled Pedestal.
  • Dependency refresh - in short order, we'll cut 0.4.1 with updated dependencies. This was pushed off to ease migration.

Thanks to everyone who has helped push Pedestal forward, and to all of those who use it!

For a full list of changes, please see this comparison of 0.3.1...0.4.0