Hi all:

I'm new to the uw imap library, sorry if these questions have been answered
many times... = p
After reading some of the documentations on the client library, I'm still
not quite sure about the threading model of the library:

From the documentations, here are the steps invovled for searching for
messages in the mailbox.
Step 1: call mail_search or mail_search_full passing in the search criteria.
Step 2: the mm_search callback will be invoked for each message that match
the criteria.

1) Can we assume that Step 2 and Step 1 will always be executed by the same
thread? And that the callback will be invoked before returning from the
mail_searchXX calls? Also, what if mulitple callbacks are invoked? Will they
be invoked sequentially using the same thread? Can we assume the same for
other mail_XXX api calls?
2) Will any of the mm callbacks ever be invoked asynchronously by threads
created by imap client library? Or will the callbacks be only executed in
respond to some mailbox operations (i.e. mail_ping), and using the same
thread as that thread used to invoke the operation? I'm mostly thinking
about the situation where the same mailbox is open by multiple processes.
Will operations by one process trigger asynchronous callbacks to the second
process?
3) I'm trying to develop a synchronous wrapper library on top of the uw imap
library. However, due to the asynchronous nature of the uw library (i.e.
responses are typically delivered through the mm callback methods), I find
myself having to do a lot of caching myself. I.e. My mm_search callback
method have to cache the matched messages, so that when the mail_search api
returns, I can then return the match messages through my wrapper interface.
Am I in the right track?

Thanks,

Stanley
_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to