Say there is a 3rd party library that is out of our control.
Say that library has a number of methods with either signature:
Task SomeMethod()
Task SomeOtherMethod(CancellationToken ct)
Now say this library cannot be trusted to function correctly.
Say these calls might never return from the call due to whatever malfunction.
How might one wrap these to handle such a situation?
One thing that I believe has been suggested was to call these in a new thread, but im not completely sure of how to do this best.
While at the same time it was suggested that this wasn’t even adequate as while the thread could be aborted, the call itself might stay alive.
Honestly Im confused.
Id love to see some examples of these calls wrapped so i might begin to understand what can be done.