cloud-software-foundation / c5

c5
Apache License 2.0
12 stars 8 forks source link

C5Server#getFiberFactory is awkward #267

Closed joshua-g closed 10 years ago

joshua-g commented 10 years ago

Per this exchange: https://github.com/OhmData/c5/commit/5bcbe0b2f49947944eb37ce932f09f2f08fe379b#commitcomment-7352168

The idea when C5FiberFactory was defined, and looking at how it's used in C5Server, was to create the factory with a certain exception handler built in, and then each of the Fibers it created would all use that exception handler. In practice, everywhere we wanted to use it had a different exception handling need, and in general they all ended up making just one fiber per factory. Even classes like ReplicatorService that created several fibers, ended up requesting a different factory for each one. I began to think it made more sense to create the fiber directly, rather than request a one-off factory just to call create().

Change getFiberFactory so it returns a c5db.util.FiberSupplier.