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

async-callback should not be invoked for filtered out items #340

Closed
plastikfan opened this issue Oct 11, 2023 · 2 comments · Fixed by #343
Closed

async-callback should not be invoked for filtered out items #340

plastikfan opened this issue Oct 11, 2023 · 2 comments · Fixed by #343
Assignees
Labels
bug Something isn't working

Comments

@plastikfan
Copy link
Contributor

The async wrapper is not decorating in the correct position, so it sees items that will be filtered out. This is inefficient and should be avoided.

@plastikfan plastikfan added the bug Something isn't working label Oct 11, 2023
@plastikfan plastikfan self-assigned this Oct 11, 2023
@plastikfan
Copy link
Contributor Author

plastikfan commented Oct 12, 2023

Actually, there is little value in fixing this because one of the points of creating the lorax project with its intended reactive model, is to simplify the initialisation sequence of extendio's navigator. The proper fix to this is the reactive model which will make this all much easier. For now, there is the problem of the filtering only applying after the async, which is too late and there isn't a quick workaround. I did think that inserting the async callback before the filter is initialised, but that would not work as it would require storing the context inside a struct, which I'm trying to avoid at all costs (I would rather build the entire required reactive model than take that route).

As a reminder to oneself, the intention is to create a sequence something like:

gorx.New(options).Filter(filter options).WithPool().Consume(...).Run(ctx, cancel)

or

gorx.New(options).Listen(listen options).Filter(filter options).Run()

or

gorx.Resume(resume options).WithPool(...).Run(ctx, cancel)

or

gorx.Resume(resume options).Run()

For the purposes of resume, all options would have to be collected and restored.

In the above, the options specified in new, do not include information relating to filters or listen as they are passed into those operators directly.

One thing that was discovered was that LabelledTraverseCallback was being referenced by value rather than be pointer, so this has been fixed.

@plastikfan
Copy link
Contributor Author

ensync BEFORE:

raw: filter
client: listener
decorated: listener
decator: boost

AFTER:
raw: filter
client: boost
decorated: listener -> N/A
decorator: boost

PROXY:

frame.raw: filter
frame.client: boost -> listener

INSIDE BOOST:
decorated.Fn: listener ==> ie the thing its delegating to is not the filtered item

this is being caused by the bad decision to use the raw pointer; this is confusing everything and making the code brittle and hard to work with

WORKER:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant