File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 55use Utopia \Proxy \Resolver ;
66use Utopia \Proxy \Resolver \Result ;
77use Utopia \Proxy \Server \HTTP \Swoole as HTTPServer ;
8- use Utopia \Proxy \Server \HTTP \SwooleCoroutine as HTTPCoroutineServer ;
8+ use Utopia \Proxy \Server \HTTP \Swoole \ Coroutine as HTTPCoroutineServer ;
99
1010/**
1111 * HTTP Proxy Server Example
Original file line number Diff line number Diff line change 88use Utopia \Proxy \Adapter ;
99use Utopia \Proxy \Protocol ;
1010use Utopia \Proxy \Resolver ;
11+ use Utopia \Proxy \Server \HTTP \Swoole \Handler ;
1112
1213/**
1314 * High-performance HTTP proxy server (Swoole Implementation)
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Utopia \Proxy \Server \HTTP ;
3+ namespace Utopia \Proxy \Server \HTTP \ Swoole ;
44
5- use Swoole \Coroutine ;
5+ use Swoole \Coroutine as SwooleCoroutine ;
66use Swoole \Coroutine \Http \Server as CoroutineServer ;
77use Utopia \Console ;
88use Utopia \Proxy \Adapter ;
99use Utopia \Proxy \Protocol ;
1010use Utopia \Proxy \Resolver ;
11+ use Utopia \Proxy \Server \HTTP \Config ;
1112
1213/**
1314 * High-performance HTTP proxy server (Swoole Coroutine Implementation)
1415 *
1516 * Example:
1617 * ```php
1718 * $resolver = new MyFunctionResolver();
18- * $server = new SwooleCoroutine ($resolver, new Config(host: '0.0.0.0', port: 80));
19+ * $server = new Coroutine ($resolver, new Config(host: '0.0.0.0', port: 80));
1920 * $server->start();
2021 * ```
2122 */
22- class SwooleCoroutine
23+ class Coroutine
2324{
2425 use Handler;
2526
@@ -100,15 +101,15 @@ public function onWorkerStart(int $workerId = 0): void
100101
101102 public function start (): void
102103 {
103- if (Coroutine ::getCid () > 0 ) {
104+ if (SwooleCoroutine ::getCid () > 0 ) {
104105 $ this ->onStart ();
105106 $ this ->onWorkerStart (0 );
106107 $ this ->server ->start ();
107108
108109 return ;
109110 }
110111
111- Coroutine \run (function (): void {
112+ SwooleCoroutine \run (function (): void {
112113 $ this ->onStart ();
113114 $ this ->onWorkerStart (0 );
114115 $ this ->server ->start ();
Original file line number Diff line number Diff line change 11<?php
22
3- namespace Utopia \Proxy \Server \HTTP ;
3+ namespace Utopia \Proxy \Server \HTTP \ Swoole ;
44
55use Swoole \Coroutine \Channel ;
66use Swoole \Coroutine \Client as CoroutineClient ;
99use Swoole \Http \Response ;
1010use Utopia \Console ;
1111use Utopia \Proxy \Adapter ;
12+ use Utopia \Proxy \Server \HTTP \Config ;
13+ use Utopia \Proxy \Server \HTTP \Telemetry ;
1214use Utopia \Validator \Hostname ;
1315
1416/**
You can’t perform that action at this time.
0 commit comments