You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LoopDriverFactory SHOULD be used by driver implementations
to set a default event loop driver.
This can be achieved by having a Composer autoloader like that:
{
"autoload": {
"files": ["src/bootstrap.php"]
}
}
Where src/bootstrap.php contains the following code:
use Interop\Async\EventLoop\LoopDriverFactory;
class MyDriverFactory implements LoopDriverFactory
{
public function create()
{
return new MyDriver();
}
}
Loop::setFactory(new MyDriverFactory());
This ensures the user doesn't have to care about setting the actual
driver. A user just has to require the specific event loop driver
package he / she wants to use.
0 commit comments