Skip to content

Utilities for deferring a request to a later time and checking on the status of the request

Notifications You must be signed in to change notification settings

zeroem/ZeroemDeferredRequestBundle

Repository files navigation

ZeroemDeferredRequestBundle

Provides utilities to mark controller actions as deferred. By simply adding the @Defer annotation to any Controller or Action, the request will be intercepted during the KernelEvents::CONTROLLER phase of the HttpKernel. At this point in time, the Request object will be serialized and stored in the database for later processing via the deferred-request:process console command.

When a Request is deferred, an appropriate HTTP 202 Response is returned containing :

  • A Content-Location Header indicating where the deferred Response will be found
  • A Link Header indicating where the status of the deferred Request may be monitored

Examples

Defer a single controller action

// ...

/**
 * @Defer
 */
public function indexAction() 
{

}

// ...

Defer all actions on a controller

/**
 * @Defer
 */
class FooController extends Controller
{
   // Actions...
}

About

Utilities for deferring a request to a later time and checking on the status of the request

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages