Colton Idle
02/14/2024, 5:22 PMcallback.onCalledBack {
if (noResponseHasComeBackAsSuccessfulYet) {
makeCallToThirdParty(it)
}
}
so basically, the fact that I use a boolean is kinda bad because the callback happens a bunch of times now. The solution? Flows! But I suck at flows. What should I use? StateFlow, just a regular flow? I think I want this to initially just work as a queue where I don't send anything to the third party if there is already something in flight. Long term, it wouldn't be bad to just send a bunch of calls to the thirdParty (its cheap) and the first one back wins. idk. Thinking out loud. Thoughts anyone?
I think I just want this
callback.onCalledBack {
addToQueue(it)
}
and then something just subscribes to the queue and handles things procedurallyColton Idle
02/14/2024, 8:38 PMephemient
02/14/2024, 10:58 PMColton Idle
02/14/2024, 11:50 PM