How do you integrate async code with synchronous libraries?

Technical