A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://stackoverflow.com/questions/76709598/how-to-get-main-thread-variables-in-rxjava3 below:

rx java - how to get main thread variables in RxJava3

Say I have some variables stored in ThreadLocal and how can I fetch them in below 'mapper' method?

ThreadLocal<String> data = new ThreadLocal<>();
data.set("some data");

Flowable.fromIterable(xxx)
                .parallel(4)
                .runOn(io())
                .map(this::mapper)
                .sequential()
                .blockingStream().collect(Collectors.toList());

asked Jul 18, 2023 at 4:46

rellocs woodrellocs wood

1,49155 gold badges2424 silver badges4040 bronze badges

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4