MCPcopy Create free account
hub / github.com/aws-samples/aws-lambda-extensions / main

Function main

go-example-extension/main.go:24–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22)
23
24func main() {
25 ctx, cancel := context.WithCancel(context.Background())
26
27 sigs := make(chan os.Signal, 1)
28 signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT)
29 go func() {
30 s := <-sigs
31 cancel()
32 println(printPrefix, "Received", s)
33 println(printPrefix, "Exiting")
34 }()
35
36 res, err := extensionClient.Register(ctx, extensionName)
37 if err != nil {
38 panic(err)
39 }
40 println(printPrefix, "Register response:", prettyPrint(res))
41
42 // Will block until shutdown event is received or cancelled via the context.
43 processEvents(ctx)
44}
45
46func processEvents(ctx context.Context) {
47 for {

Callers

nothing calls this directly

Calls 3

prettyPrintFunction · 0.70
processEventsFunction · 0.70
RegisterMethod · 0.45

Tested by

no test coverage detected