Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for DoWithContext (0.21 sec)

  1. internal/once/init.go

    		atomic.StoreUint32(&l.done, 1)
    	}
    	return nil
    }
    
    // DoWithContext is similar to Do except that it accepts a context as an argument to be passed.
    func (l *Init) DoWithContext(ctx context.Context, f func(context.Context) error) error {
    	if atomic.LoadUint32(&l.done) == 0 {
    		return l.doWithContext(ctx, f)
    	}
    	return nil
    }
    
    func (l *Init) doWithContext(ctx context.Context, f func(context.Context) error) error {
    	l.m.Lock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 09 04:20:31 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  2. internal/logger/target/http/http.go

    }
    
    // Init validate and initialize the http target
    func (h *Target) Init(ctx context.Context) (err error) {
    	if h.config.QueueDir != "" {
    		return h.initQueueOnce.DoWithContext(ctx, h.initDiskStore)
    	}
    	return h.initQueueOnce.DoWithContext(ctx, h.initMemoryStore)
    }
    
    func (h *Target) initDiskStore(ctx context.Context) (err error) {
    	ctx, cancel := context.WithCancel(ctx)
    	h.storeCtxCancel = cancel
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  3. internal/logger/target/kafka/kafka.go

    	if !h.kconfig.Enabled {
    		return nil
    	}
    	if err := h.validate(); err != nil {
    		return err
    	}
    	if h.kconfig.QueueDir != "" {
    		if err := h.initQueueStoreOnce.DoWithContext(ctx, h.initQueueStore); err != nil {
    			return err
    		}
    		return h.initKafkaOnce.Do(h.init)
    	}
    	if err := h.init(); err != nil {
    		return err
    	}
    	go h.startKafkaLogger()
    	return nil
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 10.1K bytes
    - Viewed (1)
Back to top