[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2870: async initialization of Client (was: tahoe Service/Multiservice objects should use startService)
Tahoe-LAFS
trac at tahoe-lafs.org
Mon Mar 6 20:51:02 UTC 2017
#2870: async initialization of Client
-------------------------+-----------------------
Reporter: dawuud | Owner:
Type: defect | Status: new
Priority: normal | Milestone: undecided
Component: unknown | Version: 1.12.1
Resolution: | Keywords:
Launchpad Bug: |
-------------------------+-----------------------
Description changed by meejah:
Old description:
> the tahoe source code has many services which perform their async
> initialization in their class constructor whereas they should probably be
> using startService for that.
New description:
Client, among other things, follow a pattern like this:
- their `__init__` has a bunch of non-trivial code, including creating
other objects and possibly doing async things
- if other things need to know "when they're ready" there are tricks like
`when_ready` methods.
Instead this code should be written like this:
- a `create_thing` factory-method (that is async) is created
- all non-trivial objects are instantiated outside and passed it
- IService and `startService` should be used solely for startup
notification
--
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2870#comment:1>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list