Closed meejah closed 7 years ago
On the bikeshed-api-names/downside: ideally we'd just have something like txtorcon.launch()
and txtorcon.connect()
as "the" API that returns Tor
instances, but there's already a txtorcon.launch_tor()
.
Probably the best path forward is to deprecate launch_tor()
but leave it around for now (to avoid breaking existing code) and remove it one (major) version after launch()
is introduced.
this is txtorcon.Tor
in controller.py
After discussions with @warner (thanks!) I have been convinced that a "higher level" API that abstracts/represents "a running Tor" is a good idea. This instance would be returned from "connect to tor" or "launch a new tor" factory-functions, and give access to the TorControlProtocol instance.
On top of that, it acts as a Factory/Builder for other interesting instances: TorState, TorConfig, client- and server- side endpoints, etc.
There is an early prototype in the "control" branch: https://github.com/meejah/txtorcon/tree/controller