MCPcopy
hub / github.com/sanic-org/sanic / set_state

Method set_state

sanic/worker/process.py:54–61  ·  view source on GitHub ↗
(self, state: ProcessState, force=False)

Source from the content-addressed store, hash-verified

52 self.spawn()
53
54 def set_state(self, state: ProcessState, force=False):
55 if not force and state < self.state:
56 raise Exception("...")
57 self.state = state
58 self.worker_state[self.name] = {
59 **self.worker_state[self.name],
60 "state": self.state.name,
61 }
62
63 def start(self):
64 os.environ["SANIC_WORKER_NAME"] = self.name

Callers 7

startMethod · 0.95
joinMethod · 0.95
terminateMethod · 0.95
restartMethod · 0.95
startMethod · 0.80
_sync_statesMethod · 0.80
startFunction · 0.80

Calls

no outgoing calls

Tested by 1

startFunction · 0.64