Execute fire and forget for long running process #1209
-
Hi! I need to implement a method that would trigger fire and forget behavior. The code I wrote are something like this: public Uni<String> startProcess() {
longRunningProcess().subcribe().with(logger::info(message))
return Uni.createFrom().item("Processing");
}
public Uni<String> longRunningProcess() {
//Perform long running task then return with String: "Finished"
} This code seems to work as my expected behavior. Is this code functioning as intended, or is there room for improvement? |
Beta Was this translation helpful? Give feedback.
Answered by
cescoffier
Feb 8, 2023
Replies: 1 comment 1 reply
-
In general, when I need to do such kind of things, I use the following pattern:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
DevEnol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In general, when I need to do such kind of things, I use the following pattern: