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

resolve gather #131

Closed
Tracked by #122
plastikfan opened this issue Mar 26, 2024 · 1 comment
Closed
Tracked by #122

resolve gather #131

plastikfan opened this issue Mar 26, 2024 · 1 comment
Assignees
Labels
refactor Refactor code

Comments

@plastikfan
Copy link
Contributor

plastikfan commented Mar 26, 2024

fix the issue of gather not working because it cannot send a channel over a channel on the op. The poroblem exists because the channel is strongly typed to the item value T, meaning that only instances of T can be sent.

Of(op).SendContext(ctx, gather) // gather is the wrong type

It may be that we revert the T on Item back to interface{}, so that we can send the channel of T through the op channel (operator[T]). This would then require on both ends of the channel a type check to convert the value to the required type.

We probably need to create a new Item method: SendChContext that is specialised for sending a channel over an op channel. We probably need to combine this with a new op to compement Of, perhaps Ch (to represent a channel). If we had Ch(op), then we could still use the name SendContext, rather than SendChContext. Also, we might have to create a new member on Item, that contains the channel/op of T, that can be used by Ch. If we can find the correct solution using Ch, we can still keep Item.V as a strongly typed value.

Actually, we may be able to fix other problems by stipulating the T is not any, but 'constraints.Ordered'

@plastikfan plastikfan mentioned this issue Mar 26, 2024
59 tasks
@plastikfan plastikfan self-assigned this Mar 26, 2024
@plastikfan plastikfan added the refactor Refactor code label Mar 26, 2024
@plastikfan
Copy link
Contributor Author

this was fixed under issue #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor code
Projects
None yet
Development

No branches or pull requests

1 participant