Camel: Add an asynchronous API.
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 23 Sep 2010 18:04:32 +0000 (14:04 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 28 Sep 2010 15:36:48 +0000 (11:36 -0400)
commitcea02d071c2e5334d5f38b802d32e47bf06766cc
tree0f79b76ab79959978d20c0b46a8acd70cf699d6c
parent68a4fe903696822894def062d300155f2646cc14
Camel: Add an asynchronous API.

Add pairs of asynchronous "dispatch" and "finish" methods for most
blocking "sync" methods in Camel's public API.  All asynchronous methods
have default implementations that just call its synchronous counterpart
from a thread in GIO's thread pool (which is roughly equivalent to what
Evolution is doing from its own thread pool).

The possibility for Camel providers to implement an asynchronous
architecture by overriding the asynchronous methods exists, but first
requires some cleanup in the synchronous dispatching functions, many of
which are not "pure" in the sense that they do extra stuff before and
after calling the class method they wrap.  That extra logic needs to
somehow run as part of the class method itself, either via chaining up
from subclasses or some other means.

In simpler terms, the following invariant must hold before providers can
override asynchronous methods and expect correct behavior from Camel:

    Calling camel_foo_frobnicate_sync(foo) is equivalent to calling
    CAMEL_FOO_GET_CLASS (foo)->frobnicate_sync (foo), just with fewer
    runtime checks.
68 files changed:
camel/camel-cipher-context.c
camel/camel-cipher-context.h
camel/camel-data-wrapper.c
camel/camel-data-wrapper.h
camel/camel-db.h
camel/camel-disco-diary.c
camel/camel-disco-folder.c
camel/camel-filter-driver.c
camel/camel-folder-search.c
camel/camel-folder-summary.c
camel/camel-folder-summary.h
camel/camel-folder.c
camel/camel-folder.h
camel/camel-gpg-context.c
camel/camel-mime-message.c
camel/camel-mime-message.h
camel/camel-mime-part-utils.c
camel/camel-mime-part.c
camel/camel-mime-part.h
camel/camel-multipart-signed.c
camel/camel-net-utils.c
camel/camel-offline-folder.c
camel/camel-offline-folder.h
camel/camel-operation.c
camel/camel-operation.h
camel/camel-sasl.c
camel/camel-sasl.h
camel/camel-smime-context.c
camel/camel-store.c
camel/camel-store.h
camel/camel-transport.c
camel/camel-transport.h
camel/camel-vee-folder.c
camel/camel-vtrash-folder.c
camel/providers/groupwise/camel-groupwise-folder.c
camel/providers/groupwise/camel-groupwise-journal.c
camel/providers/groupwise/camel-groupwise-store.c
camel/providers/groupwise/camel-groupwise-transport.c
camel/providers/imap/camel-imap-folder.c
camel/providers/imap/camel-imap-folder.h
camel/providers/imap/camel-imap-journal.c
camel/providers/imapx/camel-imapx-folder.c
camel/providers/imapx/camel-imapx-server.c
camel/providers/local/camel-maildir-folder.c
camel/providers/local/camel-maildir-summary.c
camel/providers/local/camel-mbox-folder.c
camel/providers/local/camel-mbox-summary.c
camel/providers/local/camel-mh-folder.c
camel/providers/local/camel-spool-summary.c
camel/providers/nntp/camel-nntp-folder.c
camel/providers/nntp/camel-nntp-summary.c
camel/providers/pop3/camel-pop3-folder.c
camel/providers/smtp/camel-smtp-transport.c
docs/reference/camel/camel-docs.sgml
docs/reference/camel/camel-sections.txt
docs/reference/camel/tmpl/camel-cipher-context.sgml
docs/reference/camel/tmpl/camel-data-wrapper.sgml
docs/reference/camel/tmpl/camel-db.sgml
docs/reference/camel/tmpl/camel-folder-summary.sgml
docs/reference/camel/tmpl/camel-folder.sgml
docs/reference/camel/tmpl/camel-mime-message.sgml
docs/reference/camel/tmpl/camel-mime-part.sgml
docs/reference/camel/tmpl/camel-offline-folder.sgml
docs/reference/camel/tmpl/camel-operation.sgml
docs/reference/camel/tmpl/camel-sasl.sgml
docs/reference/camel/tmpl/camel-store.sgml
docs/reference/camel/tmpl/camel-transport.sgml
docs/reference/camel/tmpl/camel-unused.sgml