go.temporal.io/server/client/frontend/client.go

48 LOC · 10 covered · 38 uncovered · 2 ranges · 64 concepts · 2 introducers · 12 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 // Generates all three generated files in this package:
2 //go:generate go run ../../cmd/tools/genrpcwrappers -service frontend
3
4 package frontend
5
6 import (
7 "context"
8 "time"
9
10 "go.temporal.io/api/workflowservice/v1"
11 "go.temporal.io/server/common/debug"
12 )
13
14 const (
15 // DefaultTimeout is the default timeout used to make calls
16 DefaultTimeout = 10 * time.Second * debug.TimeoutMultiplier
17 // DefaultLongPollTimeout is the long poll default timeout used to make calls
18 DefaultLongPollTimeout = time.Minute * 3 * debug.TimeoutMultiplier
19 )
20
21 var _ workflowservice.WorkflowServiceClient = (*clientImpl)(nil)
22
23 type clientImpl struct {
24 timeout time.Duration
25 longPollTimeout time.Duration
26 client workflowservice.WorkflowServiceClient
27 }
28
29 // NewClient creates a new frontend service gRPC client
30 func NewClient(
31 timeout time.Duration,
32 longPollTimeout time.Duration,
33 client workflowservice.WorkflowServiceClient,
34 > ) workflowservice.WorkflowServiceClient { fx.go ×44
35 > return &clientImpl{
36 > timeout: timeout,
37 > longPollTimeout: longPollTimeout,
38 > client: client,
39 > }
40 > }
41
42 > func (c *clientImpl) createContext(parent context.Context) (context.Context, context.CancelFunc) { metric_client_gen.go ×4
43 > return context.WithTimeout(parent, c.timeout)
44 > }
45
46 func (c *clientImpl) createLongPollContext(parent context.Context) (context.Context, context.CancelFunc) {
47 return context.WithTimeout(parent, c.longPollTimeout)
48 }