This repository has been archived by the owner on Jan 17, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use DI to wire swoole bundle commands
- Loading branch information
Showing
8 changed files
with
79 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
services: | ||
|
||
# default configuration for services in *this* file | ||
_defaults: | ||
# automatically injects dependencies in your services | ||
autowire: true | ||
# automatically registers your services as commands, event subscribers, etc. | ||
autoconfigure: true | ||
# this means you cannot fetch services directly from the container via $container->get() | ||
# if you need to do this, you can override this setting on individual services | ||
public: false | ||
|
||
App\Bundle\SwooleBundle\Server\Counter: | ||
factory: [App\Bundle\SwooleBundle\Server\Counter, fromZero] | ||
swoole.counter.atomic: | ||
class: App\Bundle\SwooleBundle\Server\AtomicCounter | ||
factory: [App\Bundle\SwooleBundle\Server\AtomicCounter, fromZero] | ||
|
||
swoole.server.http: | ||
class: Swoole\Http\Server | ||
|
||
swoole.server.run_command: | ||
class: App\Bundle\SwooleBundle\Command\ServerRunCommand | ||
arguments: | ||
$server: '@swoole.server.http' | ||
tags: ['console.command'] | ||
|
||
swoole.server.profile_command: | ||
class: App\Bundle\SwooleBundle\Command\ServerProfileCommand | ||
arguments: | ||
$counter: '@swoole.counter.atomic' | ||
$server: '@swoole.server.http' | ||
tags: ['console.command'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
use Swoole\Atomic; | ||
|
||
final class Counter | ||
final class AtomicCounter | ||
{ | ||
private $counter; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters