- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for getCaller (0.06 sec)
-
internal/grid/grid_test.go
started := time.Now() dl, _ := ctx.Deadline() if testing.Verbose() { fmt.Println(GetCaller(ctx).Name, "Server deadline:", time.Until(dl)) } <-ctx.Done() serverCanceled <- time.Since(started) if testing.Verbose() { fmt.Println(GetCaller(ctx).Name, "Server Context canceled with", ctx.Err(), "after", time.Since(started)) } return nil },
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 29 18:10:04 UTC 2024 - 36.4K bytes - Viewed (0) -
internal/grid/README.md
Sample handler: ```go handler := func(ctx context.Context, payload []byte, in <-chan []byte, out chan<- []byte) *RemoteErr { fmt.Println("Got request with initial payload", p, "from", GetCaller(ctx context.Context)) fmt.Println("Subroute:", GetSubroute(ctx)) for { select { case <-ctx.Done(): return nil case req, ok := <-in:
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Jan 18 07:03:17 UTC 2024 - 9.4K bytes - Viewed (0) -
internal/grid/handlers.go
type RemoteClient struct { Name string } type ( ctxCallerKey = struct{} ctxSubrouteKey = struct{} ) // GetCaller returns caller information from contexts provided to handlers. func GetCaller(ctx context.Context) *RemoteClient { val, _ := ctx.Value(ctxCallerKey{}).(*RemoteClient) return val }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 09 16:58:30 UTC 2024 - 27.7K bytes - Viewed (0) -
internal/grid/muxserver.go
outBlock chan struct{} clientPingInterval time.Duration } func newMuxStateless(ctx context.Context, msg message, c *Connection, handler StatelessHandler) *muxServer { var cancel context.CancelFunc ctx = setCaller(ctx, c.remote) if msg.DeadlineMS > 0 { ctx, cancel = context.WithTimeout(ctx, time.Duration(msg.DeadlineMS)*time.Millisecond) } else { ctx, cancel = context.WithCancel(ctx) } m := muxServer{
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 9.7K bytes - Viewed (0) -
docs/nl/docs/features.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 03 13:50:38 UTC 2024 - 10.1K bytes - Viewed (0)