Documentation ¶
Overview ¶
Copyright 2023 The acquirecloud Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2023 The acquirecloud Authors ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsOpened ¶
IsOpened checks the channel ch and returns true if it is still opened. The function may consume value from the channel if any, and it will be lost.
func WriteToManyWithControl ¶
WriteToManyWithControl tries to write to many channels with control channels (WriteDesc). The value v will be written to only one channel and its index will be returned. The WriteDesc.DoneChan cannot read anything, but be closed. If the WriteDesc.DoneChan is closed, the second return param will be false. If the value is written the second param will be true.
Types ¶
type WriteDesc ¶
type WriteDesc[T any] struct { // DonceChan is the done indicator. The channel can be used to interrupt the function // for indicating that the WrtChan should not be used for write DoneChan <-chan struct{} // WrtChan is the channel where a write operation attempt should be made WrtChan chan<- T }
WriteDesc is used by WriteToManyWithControl to describe write channels