suvera / winter-boot

Spring Boot styled - PHP8 Framework. Easy Dependency Injection and Easy Aspect Oriented magic just with annotations (Attributes).
MIT License
27 stars 2 forks source link

Can I select another asynchronous, such as Workerman? #1

Open zhanchmini opened 3 years ago

zhanchmini commented 3 years ago

This is great and will change PHP

Can I select another asynchronous, For example Workerman or GatewayWorker ?

Could it be simpler or could it be broken down into components like Spring just scaffolding that can load other frameworks or components?For example yii2 Laravel...

suvera commented 3 years ago

1) This is designed as a modular framework. modules can be enabled/disabled.

Check these modules:

Module can be easily developed.


#[Module]
class IlluminateDatabaseModule implements WinterModule {
    // see implementation examples.
}

Enable it in application.yml

modules:
    -   module: 'namespace\laravel\IlluminateDatabaseModule'
        enabled: true
        configFile: illuminate-db-config.yml

2) for Workerman or GatewayWorker

I don't have much knowledge on these, but I presume that they are similar to Swoole.

I have no plans at this moment (due to time constraints). But here is the idea how it can be extended.

currently Swoole is done like this.

class WinterWebSwooleApplication extends WinterApplicationRunner implements WinterApplication {
}

in the similar lines

class WinterWebWorkermanApplication extends WinterApplicationRunner implements WinterApplication {
}

class WinterWebGatewayWorkerApplication extends WinterApplicationRunner implements WinterApplication {
}
zhanchmini commented 3 years ago

Swoole isn't very friendly in a development environment Workerman Swoole has more options like the Spring container If you need to introduce other frameworks like YII2, what should Laravel do?