Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,229 for Chan (0.23 sec)

  1. internal/store/store.go

    type Key struct {
    	Name   string
    	IsLast bool
    }
    
    // replayItems - Reads the items from the store and replays.
    func replayItems[I any](store Store[I], doneCh <-chan struct{}, log logger, id string) <-chan Key {
    	keyCh := make(chan Key)
    
    	go func() {
    		defer xioutil.SafeClose(keyCh)
    
    		retryTicker := time.NewTicker(retryInterval)
    		defer retryTicker.Stop()
    
    		for {
    			names, err := store.List()
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. istioctl/pkg/wait/wait.go

    	})
    	return g
    }
    
    type watcher struct {
    	resultsChan chan string
    	errorChan   chan error
    	ctx         context.Context
    }
    
    func withContext(ctx context.Context) *watcher {
    	return &watcher{
    		resultsChan: make(chan string, 1),
    		errorChan:   make(chan error, 1),
    		ctx:         ctx,
    	}
    }
    
    func (w *watcher) Go(f func(chan string) error) {
    	go func() {
    		if err := f(w.resultsChan); err != nil {
    Go
    - Registered: Wed Apr 17 22:53:10 GMT 2024
    - Last Modified: Sat Feb 17 12:24:17 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  3. internal/pubsub/pubsub.go

    			select {
    			case sub.ch <- item:
    			default:
    			}
    		}
    	}
    }
    
    // Subscribe - Adds a subscriber to pubsub system
    func (ps *PubSub[T, M]) Subscribe(mask M, subCh chan T, doneCh <-chan struct{}, filter func(entry T) bool) error {
    	totalSubs := atomic.AddInt32(&ps.numSubscribers, 1)
    	if ps.maxSubscribers > 0 && totalSubs > ps.maxSubscribers {
    		atomic.AddInt32(&ps.numSubscribers, -1)
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Tue Feb 06 16:57:30 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  4. cmd/service.go

    	globalServiceFreezeMu.Lock()
    	// Close when we reach 0
    	globalServiceFreezeCnt--
    	if globalServiceFreezeCnt <= 0 {
    		// Set to a nil channel.
    		var _ch chan struct{}
    		if val := globalServiceFreeze.Swap(_ch); val != nil {
    			if ch, ok := val.(chan struct{}); ok && ch != nil {
    				// Close previous non-nil channel.
    				xioutil.SafeClose(ch)
    			}
    		}
    		globalServiceFreezeCnt = 0 // Don't risk going negative.
    	}
    Go
    - Registered: Sun Apr 14 19:28:10 GMT 2024
    - Last Modified: Wed Feb 28 07:02:14 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  5. internal/s3select/simdj/reader.go

    )
    
    // Reader - JSON record reader for S3Select.
    type Reader struct {
    	args    *json.ReaderArgs
    	input   chan simdjson.Stream
    	decoded chan simdjson.Object
    
    	// err will only be returned after decoded has been closed.
    	err          *error
    	readCloser   io.ReadCloser
    	onReaderExit func()
    
    	exitReader chan struct{}
    	readerWg   sync.WaitGroup
    }
    
    // Read - reads single record.
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Tue May 30 17:02:22 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  6. internal/pubsub/pubsub_test.go

    		t.Fatalf("want %d subscribers, got %d", want, got)
    	}
    }
    
    func TestSubscribeExceedingLimit(t *testing.T) {
    	ps := New[Maskable, Maskable](2)
    	ch1 := make(chan Maskable, 1)
    	ch2 := make(chan Maskable, 1)
    	ch3 := make(chan Maskable, 1)
    	doneCh := make(chan struct{})
    	defer close(doneCh)
    	if err := ps.Subscribe(MaskAll, ch1, doneCh, nil); err != nil {
    		t.Fatalf("unexpected error: %v", err)
    	}
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  7. internal/grid/grid_test.go

    	remoteHost := remote.HostName()
    
    	// 1: Echo
    	serverSent := make(chan struct{})
    	serverCanceled := make(chan struct{})
    	register := func(manager *Manager) {
    		errFatal(manager.RegisterStreamingHandler(handlerTest, StreamHandler{
    			Handle: func(ctx context.Context, payload []byte, _ <-chan []byte, resp chan<- []byte) *RemoteErr {
    				// Send many responses.
    				// Test that this doesn't block.
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Thu Feb 08 18:15:27 GMT 2024
    - 30.1K bytes
    - Viewed (0)
  8. internal/grid/handlers.go

    func (h *StreamTypeHandler[Payload, Req, Resp]) RegisterNoPayload(m *Manager, handle func(ctx context.Context, in <-chan Req, out chan<- Resp) *RemoteErr, subroute ...string) error {
    	h.WithPayload = false
    	return h.register(m, func(ctx context.Context, p Payload, in <-chan Req, out chan<- Resp) *RemoteErr {
    		return handle(ctx, in, out)
    	}, subroute...)
    }
    
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.9K bytes
    - Viewed (0)
  9. internal/grid/muxclient.go

    func (m *muxClient) handleTwowayResponses(responseCh chan<- Response, internalResp <-chan Response) {
    	defer m.parent.deleteMux(false, m.MuxID)
    	defer xioutil.SafeClose(responseCh)
    	for resp := range internalResp {
    		responseCh <- resp
    		m.send(message{Op: OpUnblockSrvMux, MuxID: m.MuxID})
    	}
    }
    
    func (m *muxClient) handleTwowayRequests(internalResp chan<- Response, requests <-chan []byte) {
    	var errState bool
    	if debugPrint {
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
  10. cni/pkg/util/util.go

    	"encoding/json"
    	"fmt"
    	"os"
    
    	"github.com/fsnotify/fsnotify"
    
    	"istio.io/istio/pkg/file"
    	"istio.io/istio/pkg/log"
    )
    
    type Watcher struct {
    	watcher *fsnotify.Watcher
    	Events  chan struct{}
    	Errors  chan error
    }
    
    // Waits until a file is modified (returns nil), the context is cancelled (returns context error), or returns error
    func (w *Watcher) Wait(ctx context.Context) error {
    	select {
    	case <-w.Events:
    Go
    - Registered: Wed Jan 24 22:53:09 GMT 2024
    - Last Modified: Thu Jul 20 18:34:43 GMT 2023
    - 3.6K bytes
    - Viewed (0)
Back to top