- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for GetSubroute (0.06 sec)
-
internal/grid/handlers.go
func GetCaller(ctx context.Context) *RemoteClient { val, _ := ctx.Value(ctxCallerKey{}).(*RemoteClient) return val } // GetSubroute returns caller information from contexts provided to handlers. func GetSubroute(ctx context.Context) string { //nolint:staticcheck // SA1029 Staticcheck is drunk. val, _ := ctx.Value(ctxSubrouteKey{}).(string) 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/grid_test.go
// 1: Echo register := func(manager *Manager) { errFatal(handler.Register(manager, func(ctx context.Context, pp *testRequest, in <-chan *testRequest, out chan<- *testResponse) *RemoteErr { sub := GetSubroute(ctx) if sub != "subroute/1" { t.Fatal("expected subroute/1, got", sub) } n := 0 for i := range in { if n > payloads { panic("too many requests") }
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/muxserver.go
} func newMuxStream(ctx context.Context, msg message, c *Connection, handler StreamHandler) *muxServer { var cancel context.CancelFunc ctx = setCaller(ctx, c.remote) if len(handler.Subroute) > 0 { ctx = setSubroute(ctx, handler.Subroute) } if msg.DeadlineMS > 0 { ctx, cancel = context.WithTimeout(ctx, time.Duration(msg.DeadlineMS)*time.Millisecond+c.addDeadline) } else { ctx, cancel = context.WithCancel(ctx) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Jun 07 15:51:52 UTC 2024 - 9.7K bytes - Viewed (0)