-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1356 from deltachat/feat/async-jobs
asyncify core & remove manual thread handling
- Loading branch information
Showing
86 changed files
with
12,101 additions
and
11,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
Delta Chat ASYNC (friedel, bjoern, floris, friedel) | ||
|
||
- smtp fake-idle/load jobs gerade noch alle fuenf sekunden , sollte alle zehn minuten (oder gar nicht) | ||
|
||
APIs: | ||
dc_context_new # opens the database | ||
dc_open # FFI only | ||
-> drop it and move parameters to dc_context_new() | ||
|
||
dc_configure # note: dc_start_jobs() is NOT allowed to run concurrently | ||
dc_imex NEVER goes through the job system | ||
dc_imex import_backup needs to ensure dc_stop_jobs() | ||
|
||
dc_start_io # start smtp/imap and job handling subsystems | ||
dc_stop_io # stop smtp/imap and job handling subsystems | ||
dc_is_io_running # return 1 if smtp/imap/jobs susbystem is running | ||
|
||
dc_close # FFI only | ||
-> can be dropped | ||
dc_context_unref | ||
|
||
for ios share-extension: | ||
Int dc_direct_send() -> try send out without going through jobs system, but queue a job in db if it needs to be retried on failure | ||
0: message was sent | ||
1: message failed to go out, is queued as a job to be retried later | ||
2: message permanently failed? | ||
|
||
EVENT handling: | ||
start a callback thread and call get_next_event() which is BLOCKING | ||
it's fine to start this callback thread later, it will see all events. | ||
Note that the core infinitely fills the internal queue if you never drain it. | ||
|
||
FFI-get_next_event() returns NULL if the context is unrefed already? | ||
|
||
sidenote: how python's callback thread does it currently: | ||
CB-thread runs this while loop: | ||
while not QUITFLAG: | ||
ev = context.get_next_event( ) | ||
... | ||
So in order to shutdown properly one has to set QUITFLAG | ||
before calling dc_stop_jobs() and dc_context_unref | ||
|
||
event API: | ||
get_data1_int | ||
get_data2_int | ||
get_data3_str | ||
|
||
|
||
- userdata likely only used for the callbacks, likely can be dropped, needs verification | ||
|
||
|
||
- iOS needs for the share app to call "try_send_smtp" wihtout a full dc_context_run and without going | ||
|
Oops, something went wrong.