async-interop / event-loop

An event loop interface for interoperability in PHP.
MIT License
170 stars 9 forks source link

Remove setFactory() side-effect and add resetDriver() #147

Closed trowski closed 7 years ago

trowski commented 7 years ago

Invoking Loop::setFactory() removes the active Driver instance as a side-effect. This PR removes this side-effect and requires a new DriverFactory instance be passed to Loop::setFactory() (instead of being nullable).

To remove the current Driver instance and force a new one to be created, a Loop::resetDriver() method is added. This method cannot be invoked while the loop is running.

kelunik commented 7 years ago

Why did you remove the nullability?

trowski commented 7 years ago

@kelunik The nullability seemed pointless… why would you explicitly remove the factory without setting another?

kelunik commented 7 years ago

Because tests or whatever.

trowski commented 7 years ago

Testing maybe… so I'll put it back.

kelunik commented 7 years ago

Closing, as project discontinued for now.