vb.net - Calling synchronous code from asynchronous method -


i have read question is proper way of calling synchronous methods asynchronously? similar question, not quite same.

i have method

private sub sendemail(strfromaddress string, strfromname string, strsubject string, strbody string, strtoaddress string, strattachment string) 

that used sending e-mail messages within program. however, avoid slight delay user, have created asynchronous method

public sub asyncsendemail(state object) 

which calls sendemail(). invoking asyncsendemail() so:

threadpool.queueuserworkitem(new waitcallback(addressof asyncsendemail), params) 

i wondering if correct way of passing off synchronous method call asynchronous method doesn't hold ui.


Comments

Popular posts from this blog

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -

java - Callback from new thread to class from which thread was initiated -