Thank you all. As was suggested, I wrote a async lib using threads.

-Madan.