user_data_manager.go ×5

Frontier kind: Code frontier

unlabeled · c_2ac9078180c5

68 tests · 3061 LOC · 144 files · introduces 0 tests · 23 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges23 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
470 ranges3061 lines · 144 files · Browse complete extent
All tests (intent)
68 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

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 native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 23 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/user_data_manager.go 15 introduced LOC · 5 ranges

Open complete file

580 ctx context.Context,
581 req *matchingservice.GetTaskQueueUserDataRequest,
582 > ) (*matchingservice.GetTaskQueueUserDataResponse, error) { user_data_manager.go
583 > lastVersion := req.GetLastKnownUserDataVersion()
584 > if lastVersion < 0 {
585 return nil, serviceerror.NewInvalidArgument("last_known_user_data_version must not be negative")
586 }
587 > lastEphVersion := req.GetLastKnownEphemeralDataVersion() user_data_manager.go
588 >
589 > if req.WaitNewData {
590 var cancel context.CancelFunc
591 ctx, cancel = contextutil.WithDeadlineBuffer(ctx, m.config.GetUserDataLongPollTimeout(), m.config.GetUserDataReturnBudget)
593 }
594
595 > for { user_data_manager.go
596 > userData, userDataChanged, err := m.GetUserData()
597 > ephData, ephDataChanged := m.getMergedEphemeralData()
598 > if errors.Is(err, errTaskQueueClosed) {
599 // If we're closing, return a success with no data, as if the request expired. We shouldn't
600 // close due to idleness (because of the MarkAlive above), so we're probably closing due to a
602 m.logger.Debug("returning empty user data (closing)", tag.Bool("long-poll", req.WaitNewData))
603 return &matchingservice.GetTaskQueueUserDataResponse{}, nil
604 > } else if err != nil { user_data_manager.go
605 return nil, err
606 }
607 > newUserData := userData.GetVersion() > lastVersion user_data_manager.go
608 > // noEphemeralDataVersion means the caller does not want ephemeral data
609 > newEphData := lastEphVersion != noEphemeralDataVersion && ephData.GetVersion() > lastEphVersion
610 > if newUserData || newEphData {
611 m.logger.Debug("returning user data",
612 tag.Bool("long-poll", req.WaitNewData),
go.temporal.io/server/api/matchingservice/v1/request_response.pb.go 8 introduced LOC · 2 ranges

Open complete file

2840 }
2841
2842 > func (x *GetTaskQueueUserDataRequest) GetLastKnownUserDataVersion() int64 { request_response.pb.go
2843 > if x != nil {
2844 > return x.LastKnownUserDataVersion
2845 > }
2846 return 0
2847 }
2848
2849 > func (x *GetTaskQueueUserDataRequest) GetLastKnownEphemeralDataVersion() int64 { request_response.pb.go
2850 > if x != nil {
2851 > return x.LastKnownEphemeralDataVersion
2852 > }
2853 return 0
2854 }