Skip to content

Commit 7044779

Browse files
authored
Reactor module readme update (#2260)
1 parent 074363b commit 7044779

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

instrumentation/reactor-3.3.0/README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# Reactor Instrumentation
22

3-
Instrumentation for Reactor Core library code.
3+
Instrumentation for Reactor Core library code. This module provides mostly the same functionality of `netty-reactor-0.9.0`, but this will only apply when netty
4+
is not being used.
45

56
This instrumentation module is a subset of the `netty-reactor-0.9.0` instrumentation. It does not contain anything related to HTTP nor starting transactions and has added Skips for when `reactor-netty` classes are present.
67

7-
The contents of the `netty-reactor` module were not moved to this module because it would cause the `tokenLift` to register twice in the `Hooks` class.
8+
Changes to `netty-reactor` should be mirrored here and vice-versa.
9+
10+
## Why not separate the functionality?
11+
`netty-reactor` modules register the `tokenLift` in the Hooks class from two different code paths, one from reactor and another from netty. To make sure that
12+
`tokenLift` is registered only once, an AtomicBoolean new field is added to the `Hooks` class. Before registering, that field is checked and if false,
13+
`tokenLift` is registered and the field is set to true.
14+
15+
The code cannot be separated in modules because the new field is not visible across modules, so there would be no way to make sure that `tokenLift` gets
16+
registered only once.
817

918
## Notice
1019
This module will only properly link the code if the Mono/Flux is subscribed on a scheduler.

0 commit comments

Comments
 (0)