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

No singleton: ChannelContext, ChannelBuilder and channel cache #2455

Merged
merged 6 commits into from
May 17, 2023

Conversation

Klaim
Copy link
Member

@Klaim Klaim commented Apr 12, 2023

Both ChannelBuilder and channel cache are now fusioned into ChannelContext which is now responsible for storing and providing Channel instances, and is not a singleton anymore.

@Klaim
Copy link
Member Author

Klaim commented Apr 12, 2023

Cancelling the build because this is definitely not ready yet.
I'm having trouble making sens of the usage of make_channel(...) as it seems to often be used not really to create channel but to obtain related names/values. As I'm trying to not break the meaning of the code, for now I'm avoiding blindly adding parameters where it might not really make sense.
So this is a work-in-progress.

@Klaim Klaim force-pushed the klaim/context-not-singleton branch 2 times, most recently from 337db2c to 25befe9 Compare April 20, 2023 16:31
@Klaim Klaim force-pushed the klaim/context-not-singleton branch 4 times, most recently from de75051 to 7faa94b Compare April 26, 2023 14:11
@Klaim Klaim force-pushed the klaim/context-not-singleton branch 3 times, most recently from 75256d3 to 0231acd Compare May 16, 2023 09:39
@Klaim Klaim force-pushed the klaim/context-not-singleton branch from 0231acd to 29aee3c Compare May 17, 2023 09:54
@Klaim Klaim marked this pull request as ready for review May 17, 2023 12:40
@Klaim Klaim requested review from JohanMabille, AntoinePrv, wolfv and Hind-M and removed request for JohanMabille May 17, 2023 12:40
@Klaim
Copy link
Member Author

Klaim commented May 17, 2023

Note that a lot of cases where ChannelContext is added as a parameter of a function is because that function will use .make_channel just to "parse" a channel value and extract some of it's information (like it's name). We had some discussions about this and some potential plans, I did NOT address this here and just made the ChannelContext available where it's need. Future refactoring might remove that parameters where I added it here.

Copy link
Member

@AntoinePrv AntoinePrv left a comment

Choose a reason for hiding this comment

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

Well done 🎉 I could not really follow everywhere, but I have not seen anything shocking.
Let's merge this before it starts conflicting with everything.

@@ -69,7 +71,7 @@ namespace mamba
{
if (ctx.output_params.json)
{
std::cout << q.find(query).groupby("name").json().dump(4);
std::cout << q.find(query).groupby("name").json(pool.channel_context()).dump(4);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
std::cout << q.find(query).groupby("name").json(pool.channel_context()).dump(4);
std::cout << q.find(query).groupby("name").json(channel_context).dump(4);

Copy link
Member

Choose a reason for hiding this comment

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

And similar below.

@AntoinePrv AntoinePrv merged commit ea8249b into mamba-org:main May 17, 2023
20 checks passed
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.

None yet

2 participants