Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for NewErrorChannel (0.11 sec)

  1. pkg/scheduler/framework/parallelize/error_channel.go

    func (e *ErrorChannel) ReceiveError() error {
    	select {
    	case err := <-e.errCh:
    		return err
    	default:
    		return nil
    	}
    }
    
    // NewErrorChannel returns a new ErrorChannel.
    func NewErrorChannel() *ErrorChannel {
    	return &ErrorChannel{
    		errCh: make(chan error, 1),
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 20 17:39:23 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  2. pkg/scheduler/framework/parallelize/error_channel_test.go

    limitations under the License.
    */
    
    package parallelize
    
    import (
    	"context"
    	"errors"
    	"testing"
    )
    
    func TestErrorChannel(t *testing.T) {
    	errCh := NewErrorChannel()
    
    	if actualErr := errCh.ReceiveError(); actualErr != nil {
    		t.Errorf("expect nil from err channel, but got %v", actualErr)
    	}
    
    	err := errors.New("unknown error")
    	errCh.SendError(err)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 20 17:39:23 UTC 2021
    - 1.3K bytes
    - Viewed (0)
Back to top