CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 22:45:11 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"c4ddb61d525ed95a1ef2aa1dfa2847b3"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=eoh%2B%2FuW0VQWvEOnYt3c7HMdBPdJLsflHFOpqNC11qbSYA2E8IAyxFBCc0kEeIpfpD5IV%2ByTXzrFLhYM%2BQuzEm1bSK0Rt%2FCzu5CMD%2BGHOHyUNm%2FXk3AUFpMxjl%2FhUXvSXgEgkoqrzlLh8QbVzbAf0UsSS%2FfSBvfvmRXkyZwTe3%2FFaUREaKtQu72MK8VSDstLATeQd3RT%2FQJq%2FKx9ixwWxFfHeVEE688pH00DSlgPLqtZ2bzVjNeNUf6RcefUIJY%2BNIymPhZ1aYPLmdV2aDwNUWQ%3D%3D--eXQEpTQWJDzfHWYO--8Y3%2BwlU6ByQBeBhFow3FUw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1336227212.1753656310; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 22:45:10 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 22:45:10 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: BEE0:5FFA9:120DC62:17C463B:6886ABF6
events · scil/LaravelFly Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
This repository was archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
events
scil edited this page Aug 20, 2018
·
1 revision
Laravel has an dispatcher named 'events' in container, which is an app events dispatcher for Laravelfly.
There is another server dispatcher (Symfony\Component\EventDispatcher).
The app dispatcher objects does not created until the Laravel app created.
- worker.starting
available args: $event['server'], $event['workerid'] the swooler http server wrapped in a Laravelfly server can be got by $event['server']->getSwoole(). - laravel.ready
available args: $event['server'], $event['app'], $event['request']
the $event['request'] is null unless FpmLike is used. - Laravel provides event 'bootstrapping' and event 'bootstrapped' of multiple Bootstrap classes listed in your kernel class
In Mode Map, callbacks bootingCallbacks are called after the event 'bootstrapping: LaravelFly\Map\Bootstrap\RegisterAndBootProvidersOnWork', before the event 'bootstrapped: LaravelFly\Map\Bootstrap\RegisterAndBootProvidersOnWork' - worker.ready
available args: $event['server'], $event['workerid'], $event['app']
the $event['app'] is null with Mode FpmLike.
In Mode Simple or Map, this event may look like 'PHP_MINIT_FUNCTION' in php ext, or 'before_first_request' in python Flask. - worker.stopped
available args: $event['server'] ,$event['workerid'], $event['app']
Events provides by laravelfly are instances of Symfony\Component\EventDispatcher\GenericEvent, they can be used like
$dispatcher = \LaravelFly\Fly::getServer()->getDispatcher();
$dispatcher->addListener('worker.starting', function (GenericEvent $event) {
echo "There files can not be hot reloaded, because they are included before worker starting\n";
var_dump(get_included_files());
});
$dispatcher->addListener('laravel.ready', function (GenericEvent $event) {
$event['app']->instance('tinker', \LaravelFly\Tinker\Shell::$instance);
});
$dispatcher can also be available in a new server class which extends LaravelFly\Server\HttpServer or LaravelFly\Server\FpmHttpServer.
class MyServer extends \LaravelFly\Server\HttpServer
{
public function start()
{
$this->dispatcher->addListener('laravel.ready', function (GenericEvent $event) {
$event['app']->instance('tinker', \LaravelFly\Tinker\Shell::$instance);
});
parent::start();
}
}
Put the new class in the server config file fly.conf.php
'server' => MyServer::class,
- request.corinit
- bootedCallbacks (callbacks provided by laravel)
register a callback: app()->booted($callback) - Illuminate\Routing\Events\RouteMatched (provided by laravel)
- Illuminate\Foundation\Http\Events\RequestHandled (provided by laravel)
- terminatingCallbacks (callbacks provided by laravel)
register a callback: app()->terminating($callback) - request.corunset
- bootingCallbacks (callbacks provided by laravel)
- bootedCallbacks (callbacks provided by laravel)
- Illuminate\Routing\Events\RouteMatched
- Illuminate\Foundation\Http\Events\RequestHandled
- terminatingCallbacks (callbacks provided by laravel)
- Start
- Coding Guideline
- Deploy and OS Configuration
- New API
- Design
- Dev about Mode Map
- Dev about Mode Backup
Clone this wiki locally
You can’t perform that action at this time.