Skip to content

Deferred function helper execute the task before the HTTP response has been sent to the user #53055

@saychool

Description

@saychool

Laravel Version

11.26

PHP Version

8.3

Database Driver & Version

Postgresql 16 self hosted on ubuntu 24

Description

upgraded to laravel 11.x from 10.x and still has app/Http/Kernel.php file, adding InvokeDeferredCallbacks to my Kernel.php already like the documentation told (here), but i think the helper didn't work correctly

Steps To Reproduce

Route::get('/testingDefer', function () {
    defer(function () {
        sleep(10);
    });

    return true;
});

just a simple test, i did some complex code before but simple test are enough to reproduce

{8710F3E8-B8EA-43CE-829C-DF59ABD69AAC}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions