This repository was archived by the owner on May 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathroadrunner.php
152 lines (129 loc) · 5.16 KB
/
roadrunner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
use Spiral\RoadRunner\Environment\Mode;
use Spiral\RoadRunnerLaravel\Defaults;
use Spiral\RoadRunnerLaravel\Events;
use Spiral\RoadRunnerLaravel\Listeners;
return [
'rpc' => [
'host' => env('RPC_HOST', 'tcp://127.0.0.1:6001'),
],
'session' => [
'storage' => 'session',
],
'cache' => [
'storage' => 'cache',
],
/*
|--------------------------------------------------------------------------
| Force HTTPS Schema Usage
|--------------------------------------------------------------------------
|
| Set this value to `true` if your application uses HTTPS (required for
| correct links generation, for example).
|
*/
'force_https' => (bool) env('APP_FORCE_HTTPS', false),
/*
|--------------------------------------------------------------------------
| Event Listeners
|--------------------------------------------------------------------------
|
| Worker provided by this package allows to interacts with request
| processing loop using application events.
|
| Feel free to add your own event listeners.
|
*/
'listeners' => [
Events\BeforeLoopStartedEvent::class => [
...Defaults::beforeLoopStarted(),
\App\Listeners\RoadRunner\RegisterConsoleStreamHandlerListener::class,
// Listeners\SetupTelescopeListener::class, // for <https://github.com/laravel/telescope>
],
Events\BeforeLoopIterationEvent::class => [
...Defaults::beforeLoopIteration(),
// Listeners\ResetLaravelScoutListener::class, // for <https://github.com/laravel/scout>
// Listeners\ResetLaravelSocialiteListener::class, // for <https://github.com/laravel/socialite>
Listeners\ResetInertiaListener::class, // for <https://github.com/inertiajs/inertia-laravel>
Listeners\ResetZiggyListener::class, // for <https://github.com/tighten/ziggy>
],
\Infrastructure\RoadRunner\TCP\Events\BeforeLoopIterationEvent::class => [
...Defaults::beforeLoopIteration(),
],
Events\BeforeRequestHandlingEvent::class => [
...Defaults::beforeRequestHandling(),
Listeners\InjectStatsIntoRequestListener::class,
],
Events\AfterRequestHandlingEvent::class => [
...Defaults::afterRequestHandling(),
\App\Listeners\Request\SendRequestDebugToConsole::class,
],
Events\AfterLoopIterationEvent::class => [
...Defaults::afterLoopIteration(),
\Infrastructure\CycleOrm\Listeners\ClearIdentityMap::class,
Listeners\RunGarbageCollectorListener::class, // keep the memory usage low
],
\Infrastructure\RoadRunner\TCP\Events\AfterLoopIterationEvent::class => [
...Defaults::afterLoopIteration(),
\Infrastructure\CycleOrm\Listeners\ClearIdentityMap::class,
Listeners\RunGarbageCollectorListener::class, // keep the memory usage low
],
Events\AfterLoopStoppedEvent::class => [
...Defaults::afterLoopStopped(),
],
Events\LoopErrorOccurredEvent::class => [
...Defaults::loopErrorOccurred(),
Listeners\SendExceptionToStderrListener::class,
Listeners\StopWorkerListener::class,
],
],
/*
|--------------------------------------------------------------------------
| Containers Pre Resolving / Clearing
|--------------------------------------------------------------------------
|
| The bindings listed below will be resolved before the events loop
| starting. Clearing a binding will force the container to resolve that
| binding again when asked.
|
| Feel free to add your own bindings here.
|
*/
'warm' => [
...Defaults::servicesToWarm(),
],
'clear' => [
...Defaults::servicesToClear(),
'auth', // is not required for Laravel >= v8.35
],
/*
|--------------------------------------------------------------------------
| Reset Providers
|--------------------------------------------------------------------------
|
| Providers that will be registered on every request.
|
| Feel free to add your service-providers here.
|
*/
'reset_providers' => [
...Defaults::providersToReset(),
Illuminate\Auth\AuthServiceProvider::class, // is not required for Laravel >= v8.35
Illuminate\Pagination\PaginationServiceProvider::class, // is not required for Laravel >= v8.35
],
/*
|--------------------------------------------------------------------------
| Worker Classes
|--------------------------------------------------------------------------
|
| Here you can override the worker class for processing different kinds of
| jobs, that received from the RoadRunner daemon.
|
*/
'workers' => [
Mode::MODE_HTTP => \Spiral\RoadRunnerLaravel\Worker::class,
Mode::MODE_JOBS => \Infrastructure\RoadRunner\Queue\Worker::class,
'tcp' => \Infrastructure\RoadRunner\TCP\Worker::class,
// Mode::MODE_TEMPORAL => ...,
],
];