notifier.go ×8

Frontier kind: Code frontier

unlabeled · c_ca1dbc03cb14

16 tests · 2488 LOC · 124 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
384 ranges2488 lines · 124 files · Browse complete extent
All tests (intent)
16 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.

1 file ranked by introduced lines: 24 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/history/events/notifier.go 24 introduced LOC · 8 ranges

Open complete file

127
128 func (notifier *NotifierImpl) WatchHistoryEvent(
129 > identifier definition.WorkflowKey) (string, chan *Notification, error) { notifier.go
130 >
131 > channel := make(chan *Notification, 1)
132 > subscriberID := uuid.NewString()
133 > subscribers := map[string]chan *Notification{
134 > subscriberID: channel,
135 > }
136 >
137 > _, _, err := notifier.eventsPubsubs.PutOrDo(identifier, subscribers, func(key any, value any) error {
138 subscribers := value.(map[string]chan *Notification)
139
146 })
147
148 > if err != nil { notifier.go
149 return "", nil, err
150 }
151
152 > return subscriberID, channel, nil notifier.go
153 }
154
155 func (notifier *NotifierImpl) UnwatchHistoryEvent(
156 > identifier definition.WorkflowKey, subscriberID string) error { notifier.go
157 >
158 > success := true
159 > notifier.eventsPubsubs.RemoveIf(identifier, func(key any, value any) bool {
160 > subscribers := value.(map[string]chan *Notification)
161 >
162 > if _, ok := subscribers[subscriberID]; !ok {
163 // cannot find the subscribe ID, which means there is a bug
164 success = false
165 > } else { notifier.go
166 > delete(subscribers, subscriberID)
167 > }
168
169 > return len(subscribers) == 0 notifier.go
170 })
171
172 > if !success { notifier.go
173 // cannot find the subscribe ID, which means there is a bug
174 return serviceerror.NewInternal("Unable to unwatch on workflow execution.")
175 }
176
177 > return nil notifier.go
178 }
179