8000 TaskLocal should propagate when used with Bracket Methods by Avasil · Pull Request #839 · monix/monix · GitHub
[go: up one dir, main page]

Skip to content

TaskLocal should propagate when used with Bracket Methods - #839

Merged
Avasil merged 1 commit into
monix:masterfrom
Avasil:TaskShift-restoring-locals
Mar 25, 2019
Merged

Avasil merged 1 commit into
monix:masterfrom
Avasil:TaskShift-restoring-locals

Conversation

@Avasil
@Avasil Avasil commented Mar 9, 2019
Copy link
Copy Markdown
Collaborator

Related to #806

Making PR as suggested by @oleg-py

The difference between

Task.unit
    .executeAsync
    .guarantee(local.write(10))

and

Task.unit
    .guarantee(local.write(10))

is that the former starts TaskRestartCallback twice (the first one is just after evaluating guarantee body) and the latter just once.

@alexandru If you could provide some explanation of TaskRestartCallback that would help immensely in putting all the pieces together. :) I feel like I'm getting somewhere with my understanding but there are a lot of guesses at this point

@oleg-py oleg-py left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've played a bit with this fix, and it seems to fix a decent number of cases at least. Found #851 as I did though, but it's not bracket-specific.

@Avasil
Avasil commented Mar 25, 2019
Copy link
Copy Markdown
Collaborator Author

I'm merging then so we can move forward, we will revert it if it turns out to be wrong

@Avasil
Avasil 8000 merged commit bfd45db into monix:master Mar 25, 2019
@Avasil
Avasil deleted the TaskShift-restoring-locals branch July 18, 2019 18:34
mdedetrich pushed a commit to mdedetrich/monix that referenced this pull request Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0