MCPcopy Index your code
hub / github.com/php/frankenphp / beforeScriptExecution

Method beforeScriptExecution

threadinactive.go:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21func (handler *inactiveThread) beforeScriptExecution() string {
22 thread := handler.thread
23
24 switch thread.state.Get() {
25 case state.TransitionRequested:
26 return thread.transitionToNewHandler()
27
28 case state.Booting, state.TransitionComplete:
29 thread.state.Set(state.Inactive)
30
31 // wait for external signal to start or shut down
32 thread.state.MarkAsWaiting(true)
33 thread.state.WaitFor(state.TransitionRequested, state.ShuttingDown)
34 thread.state.MarkAsWaiting(false)
35
36 return handler.beforeScriptExecution()
37
38 case state.ShuttingDown:
39 // signal to stop
40 return ""
41 }
42
43 panic("unexpected state: " + thread.state.Name())
44}
45
46func (handler *inactiveThread) afterScriptExecution(int) {
47 panic("inactive threads should not execute scripts")

Callers

nothing calls this directly

Calls 6

GetMethod · 0.80
SetMethod · 0.80
MarkAsWaitingMethod · 0.80
WaitForMethod · 0.80
NameMethod · 0.80

Tested by

no test coverage detected