Hello all, is there a way to do one of the two following things?
1. in a normal blocking function, determine if the function was called from a coroutine context
2. Warn a user in a meaningful way that they should not call a specific blocking function from a coroutine context (ideally by failing to compile as if i tried to call a suspend fun from a blocking fun, but a really good warning is good enough for me)
I know that if I add a false
@Throws(IOException::class)
to my method, it gets highlighted as an inappropriate blocking call in IDEA, and I can just add docs to the method and hope people read them when they get the unrelated warning. However, I’m hoping for something a little more direct.
Anyone have any ideas or pointers?