Changeset 1d32326 in trunk
- Timestamp:
- 2023-01-17T15:06:14Z (2 years ago)
- Branches:
- master
- Children:
- 290bb52
- Parents:
- eb630c39
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified integration/util.py ¶
reb630c39 r1d32326 255 255 return self.transport.exited 256 256 257 def restart_async(self, reactor, request): 257 def restart_async(self, reactor: IReactorProcess, request: Any) -> Deferred: 258 """ 259 Stop and then re-start the associated process. 260 261 :return: A Deferred that fires after the new process is ready to 262 handle requests. 263 """ 258 264 d = self.kill_async() 259 265 d.addCallback(lambda ignored: _run_node(reactor, self.node_dir, request, None, finalize=False)) 260 266 def got_new_process(proc): 267 # Grab the new transport since the one we had before is no longer 268 # valid after the stop/start cycle. 261 269 self._process_transport = proc.transport 262 270 d.addCallback(got_new_process) … … 291 299 transport.exited = protocol.exited 292 300 301 tahoe_process = TahoeProcess( 302 transport, 303 node_dir, 304 ) 305 293 306 if finalize: 294 request.addfinalizer(partial(_cleanup_tahoe_process, transport, protocol.exited, allow_missing=True)) 295 296 # XXX abusing the Deferred; should use .when_magic_seen() pattern 297 298 def got_proto(proto): 299 transport._protocol = proto 300 return TahoeProcess( 301 transport, 302 node_dir, 303 ) 304 protocol.magic_seen.addCallback(got_proto) 305 return protocol.magic_seen 307 request.addfinalizer(tahoe_process.kill) 308 309 d = protocol.magic_seen 310 d.addCallback(lambda ignored: tahoe_process) 311 return d 306 312 307 313
Note: See TracChangeset
for help on using the changeset viewer.