Skip to content

Document/implement go routine & channel guarantees #720

Open
@FlorianUekermann

Description

@FlorianUekermann

I am using the following endless loop in a go routine:

for {		
	select {
	case a := channelA:
		doSomething(a)
	case b := channelB:
		doSomething(b)
	case channelC <- 1:
	}
	doSomethingD()
}

I suspect that sending values to channelA or channelB is guaranteed to be non-blocking, as long as all the doSomethingX functions contain no blocking code. By non-blocking I mean that channel sends from JS callbacks are guaranteed to succeed.

Is my assumption correct? I couldn't find any documentation that goes into enough detail to answer this. If it isn't correct, I think there would be value in implementing such a guarantee.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions