Skip to content

Commit

Permalink
Merge pull request #1356 from deltachat/feat/async-jobs
Browse files Browse the repository at this point in the history
asyncify core & remove manual thread handling
  • Loading branch information
r10s committed May 27, 2020
2 parents 177cd52 + 23b6974 commit 19a6a30
Show file tree
Hide file tree
Showing 86 changed files with 12,101 additions and 11,248 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-03-12
toolchain: nightly-2020-03-19
override: true
- uses: actions-rs/cargo@v1
with:
Expand All @@ -25,7 +25,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-03-12
toolchain: nightly-2020-03-19
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2020-03-12
toolchain: nightly-2020-03-19
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
Expand Down
54 changes: 54 additions & 0 deletions ASYNC-API-TODO.txt
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

Loading

0 comments on commit 19a6a30

Please sign in to comment.