Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pairwise fails with asynchronous inputs #43

Closed
zsoerenm opened this issue Jan 11, 2024 · 3 comments · Fixed by #54
Closed

Pairwise fails with asynchronous inputs #43

zsoerenm opened this issue Jan 11, 2024 · 3 comments · Fixed by #54

Comments

@zsoerenm
Copy link
Contributor

Here is minimum working example:

subject = Subject(Int)
paired = subject |> pairwise()
subscribe!(paired, logger("paired"))
for i = 1:10
    @async next!(subject, i)
end

output

[paired] Data: (1, 2)
[paired] Data: (1, 4)
[paired] Data: (1, 5)
[paired] Data: (1, 6)
[paired] Data: (1, 7)
[paired] Data: (1, 8)
[paired] Data: (1, 9)
[paired] Data: (1, 10)

It does work with a little sleep in between:

julia> for i = 1:10
           @async next!(subject, i)
           sleep(0.1)
       end
[paired] Data: (1, 2)
[paired] Data: (2, 3)
[paired] Data: (3, 4)
[paired] Data: (4, 5)
[paired] Data: (5, 6)
[paired] Data: (6, 7)
[paired] Data: (7, 8)
[paired] Data: (8, 9)
[paired] Data: (9, 10)
@oliviermilla
Copy link

I'd love to understand from the pros what's going on here and how to deal with these stuffs. :)

@bvdmitri
Copy link
Member

bvdmitri commented Jun 24, 2024

Yeah, there was a bug in the order of computations in the pairwise operator. Should be fixed in #54 . Thanks for this nice catch @zsoerenm !

@bvdmitri
Copy link
Member

The fixed version should be publicly available now

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 a pull request may close this issue.

3 participants