CamelService: Rewrite connect/disconnect API.
authorMatthew Barnes <mbarnes@redhat.com>
Sat, 19 May 2012 12:41:15 +0000 (08:41 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Sat, 19 May 2012 17:43:24 +0000 (13:43 -0400)
commita182bde249c72e0ac89cc85475712aea96fb8e08
tree35321339a881cc9f9fe775d5d74f6300ea6fbaf7
parent16cd764733e169aeb3c98a27bb26a9c83023d3f8
CamelService: Rewrite connect/disconnect API.

CamelService now has proper cancellable asynchronous functions for
connect and disconnect operations.  The way this works is as follows:

The first service connect request runs asynchronously internally, even
if camel_service_connect_sync() is called.  Subsequent connect requests
are queued until the first connect request finishes, then all requests
finish simultaneously with the same result.  There are no retries; if
the first request fails, they all fail with the same error.

If a service disconnect is requested with one or more connect requests
outstanding, the connect requests are all cancelled and the disconnect
request runs asynchronously and plays by the same queueing rules.

CamelService's "connection-status" property will immediately reflect any
connect or disconnect requests in progress.  Change notification signals
for this property, however, are emitted from CamelSession's main context.
14 files changed:
camel/camel-disco-store.c
camel/camel-imapx-folder.c
camel/camel-imapx-store.c
camel/camel-offline-store.c
camel/camel-sasl-popb4smtp.c
camel/camel-service.c
camel/camel-service.h
camel/providers/imap/camel-imap-command.c
camel/providers/imap/camel-imap-store.c
camel/providers/imapx/test-imapx.c
camel/providers/nntp/camel-nntp-store.c
camel/providers/pop3/camel-pop3-store.c
camel/providers/smtp/camel-smtp-transport.c
docs/reference/camel/camel-sections.txt