12/8/2022 0 Comments Some fews of![]() Here is the final Kotlin version, nice and concise: private val log = KotlinLogging.logger ms", result, System.currentTimeMillis() - start)Īnd the output: downstream 1: ĭownstream 2: Thanks in advance for your time and help! If I can better clarify my intentions, please let me know where I have been unclear, and I will gladly attempt to clear it up. I have only been doing reactive programming for a short time, so please be patient with the way I am trying to describe what I want to do. Connecting multiple publishers is what I think would be a good answer for my need, unless this is a common pattern that can be handled in a better way. Will I need a collection object, like a list, and then use a merge operation? Initially, I thought about using a ConnectableFlux, until I realized that it is for connecting multiple subscribers, rather than for connecting multiple publishers. When some of these Flux operations should start before some of the others, how can I start them, and ensure that I do not miss any data? And if I start a name resolution Flux, for example, can I add to it, as in item 2 above? Let's say that I want to start retrieving some data, then perform a synchronous operation, and then I create another name resolution Flux from the result of the synchronous operation, can I append this new Flux to the original name resolution Flux, since it will be returning the same data type? I am aware of rge(), but it would be convenient to work with a single Flux reference that I can keep adding to, if possible.Add items to whatever I can create in item 1 above - it was initialized as empty, but I might want the data from one or multiple finite and asynchronous Flux operations, but I do not care to keep them separate, and they can appear as one stream when I will use collectList() on them to produce a Mono.Create a "holder" or a "container" for each of the Flux operations that will be needed to resolve everything, and initialize them as empty (like Flux.empty()).So eager subscription is ideal, as long as I can guarantee that I will not miss any item emission. The resolution operations are time-expensive, and I would like to be able to start some Flux operations earlier so that I can compress the time a bit - that is quite important for what I am accomplishing. Some resolution types will have all Flux operations returning data, while others gather less information, and some of the Flux operations will remain empty. Then, once the synchronous data has been resolved, I can get each Flux for the remaining operations underway. ![]() I would like to start these Flux operations while the synchronous operations are taking place. Now, while this synchronous operation is taking place, at least a portion of the overall asynchronous resolution operation can begin. I say "primarily" asynchronously because some of the resolution types require some preliminary operation(s) that must happen synchronously to provide information for the remaining asynchronous Flux operations of the resolution. The resolution is broken into multiple (primarily, again) asynchronous operations that each work on gathering different data types that contribute to the resolution. I have a module that accepts entity IDs and a "resolution type" as parameters, and then gathers data (primarily) asynchronously via multiple operations that return Fluxes. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |