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

Method beforeScriptExecution

threadregular.go:40–67  ·  view source on GitHub ↗

beforeScriptExecution returns the name of the script or an empty string on shutdown

()

Source from the content-addressed store, hash-verified

38
39// beforeScriptExecution returns the name of the script or an empty string on shutdown
40func (handler *regularThread) beforeScriptExecution() string {
41 switch handler.state.Get() {
42 case state.TransitionRequested:
43 detachRegularThread(handler.thread)
44 return handler.thread.transitionToNewHandler()
45
46 case state.TransitionComplete:
47 handler.thread.updateContext(false)
48 handler.state.Set(state.Ready)
49
50 return handler.waitForRequest()
51
52 case state.Ready:
53 return handler.waitForRequest()
54
55 case state.RebootReady:
56 handler.requestCount = 0
57 handler.state.Set(state.Ready)
58 return handler.waitForRequest()
59
60 case state.ShuttingDown:
61 detachRegularThread(handler.thread)
62 // signal to stop
63 return ""
64 }
65
66 panic("unexpected state: " + handler.state.Name())
67}
68
69func (handler *regularThread) afterScriptExecution(_ int) {
70 handler.thread.requestCount.Add(1)

Callers 1

waitForRequestMethod · 0.95

Calls 7

waitForRequestMethod · 0.95
detachRegularThreadFunction · 0.85
GetMethod · 0.80
updateContextMethod · 0.80
SetMethod · 0.80
NameMethod · 0.80

Tested by

no test coverage detected