MCPcopy Create free account
hub / github.com/buke/quickjs-go / SetExecuteTimeout

Method SetExecuteTimeout

runtime.go:885–900  ·  view source on GitHub ↗

SetExecuteTimeout will set the runtime's execute timeout; This will override any user interrupt handler (expected behavior)

(timeout uint64)

Source from the content-addressed store, hash-verified

883// SetExecuteTimeout will set the runtime's execute timeout;
884// This will override any user interrupt handler (expected behavior)
885func (r *Runtime) SetExecuteTimeout(timeout uint64) {
886 if r == nil {
887 return
888 }
889 if !r.ensureOwnerAccess() {
890 return
891 }
892 r.mu.Lock()
893 defer r.mu.Unlock()
894 if r.closed.Load() || r.ref == nil {
895 return
896 }
897 C.SetExecuteTimeout(r.ref, C.time_t(timeout))
898 // Clear user interrupt handler since timeout takes precedence
899 r.interruptHandlerState.Store(nil)
900}
901
902// SetStripInfo is retained for backward compatibility only.
903// Deprecated: quickjs-ng does not expose a runtime-level strip-info API, so this method is a no-op.

Calls 3

ensureOwnerAccessMethod · 0.95
LoadMethod · 0.80
StoreMethod · 0.80