Would somebody mind looking at this if I do wrap a 3rd party callback library correctly? Its googles mlkit barcode scanner. Its my first time
Also, what is the best pragmatic name of providing a suspend function if the "native" is called
process()
?
processSuspending()
? or some sort of
await
variant like
awaitProcess()
?
Also2, I don't need to apply dispatcher, since it provides callbacks, meaning it most likely has its own thread inside, right?
e
Erik
04/21/2021, 5:41 AM
Looks alright, assuming that
this.clear()
is the correct way to clear all resources involved in the barcode scanner
Erik
04/21/2021, 5:44 AM
I wouldn't call the function
awaitX
, because awaiting usually means using a
Deferred<T>
when working with coroutines.
Erik
04/21/2021, 5:45 AM
If you can abstract all barcode scanner domain away, then you could simply name the suspending function
process
too, because nobody needs to know the original blocking function with the same name