Skip to content

Add Context variants for Send and Receive#325

Draft
kennyp wants to merge 3 commits intonanomsg:mainfrom
kennyp:main
Draft

Add Context variants for Send and Receive#325
kennyp wants to merge 3 commits intonanomsg:mainfrom
kennyp:main

Conversation

@kennyp
Copy link
Copy Markdown

@kennyp kennyp commented Oct 7, 2025

Rationale

Closes #215 and fixes a double lock bug.

Note

A number of files were updated due to running go fmt. Happy to revert those and submit as a separate PR.

@kennyp kennyp requested a review from gdamore as a code owner October 7, 2025 19:17
@kennyp kennyp marked this pull request as draft October 7, 2025 19:20
@gdamore
Copy link
Copy Markdown
Contributor

gdamore commented Oct 7, 2025

You kept the gofmt a separate commit, so it's all good. :-) I've always done the go fmt thing, but its been a while and newer versions of go have probably changed things.

@gdamore
Copy link
Copy Markdown
Contributor

gdamore commented Oct 7, 2025

I have mixed feelings about this ... not be cause I dislike using contexts, I think contexts are great -- mangos was designed before they existed is all.

My hesitation here is two fold:

  1. The naming confusion -- I have a feeling that we should really rename mangos contexts to something else (I don't have a good answer) to avoid the confusion.
  2. I almost think we should just make passing ctx mandatory, or perhaps make it an optional argument ...ctx.....

Let me think on this -- but think about the second point. I want to come to a solution here, but we might need to be willing to make a bigger change ... like another major version of mangos.

@kennyp
Copy link
Copy Markdown
Author

kennyp commented Oct 7, 2025

I have mixed feelings about this ... not be cause I dislike using contexts, I think contexts are great -- mangos was designed before they existed is all.

My hesitation here is two fold:

  1. The naming confusion -- I have a feeling that we should really rename mangos contexts to something else (I don't have a good answer) to avoid the confusion.

Yeah, I was really torn about that bit too. I did feel like allowing the stdlib to be called context was better than aliasing it to make it less confusing to new contributors.

  1. I almost think we should just make passing ctx mandatory, or perhaps make it an optional argument ...ctx.....

Yeah, having context as required would seem to follow the Go convention for IO these days. I could see the argument for v4, but if we're going there what else would you want to include?

Let me think on this -- but think about the second point. I want to come to a solution here, but we might need to be willing to make a bigger change ... like another major version of mangos.

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.

Want context.Context versions of send, receive

2 participants