MCPcopy
hub / github.com/loong/go-concurrency-exercises / createMockRequest

Function createMockRequest

3-limit-service-time/mockserver.go:40–51  ·  view source on GitHub ↗
(pid int, fn func(), u *User)

Source from the content-addressed store, hash-verified

38}
39
40func createMockRequest(pid int, fn func(), u *User) {
41 fmt.Println("UserID:", u.ID, "\tProcess", pid, "started.")
42 res := HandleRequest(fn, u)
43
44 if res {
45 fmt.Println("UserID:", u.ID, "\tProcess", pid, "done.")
46 } else {
47 fmt.Println("UserID:", u.ID, "\tProcess", pid, "killed. (No quota left)")
48 }
49
50 wg.Done()
51}
52
53func shortProcess() {
54 time.Sleep(6 * time.Second)

Callers 1

RunMockServerFunction · 0.85

Calls 1

HandleRequestFunction · 0.85

Tested by

no test coverage detected