Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 396 for cancelFn (0.19 sec)

  1. internal/grid/muxclient.go

    	}
    }
    
    func (m *muxClient) close() {
    	if debugPrint {
    		fmt.Println("closing outgoing mux", m.MuxID)
    	}
    	if !m.respMu.TryLock() {
    		// Cancel before locking - will unblock any pending sends.
    		if m.cancelFn != nil {
    			m.cancelFn(context.Canceled)
    		}
    		// Wait for senders to release.
    		m.respMu.Lock()
    	}
    
    	defer m.respMu.Unlock()
    	m.closeLocked()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
  2. internal/grid/connection.go

    	c.updateState(StateConnected)
    	ctx, cancel := context.WithCancelCause(ctx)
    	defer cancel(ErrDisconnected)
    
    	// This will ensure that is something asks to disconnect and we are blocked on reads/writes
    	// the connection will be closed and readers/writers will unblock.
    	go c.monitorState(conn, cancel)
    
    	c.handleMsgWg.Add(2)
    	c.reconnectMu.Unlock()
    
    	// Read goroutine
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

       */
      override fun cancel() {
        if (canceled) return // Already canceled.
    
        canceled = true
        exchange?.cancel()
        for (plan in plansToCancel) {
          plan.cancel()
        }
    
        eventListener.canceled(this)
      }
    
      override fun isCanceled(): Boolean = canceled
    
      override fun execute(): Response {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  4. internal/grid/stream.go

    // Results returns the results from the remote server one by one.
    // If any error is returned by the callback, the stream will be canceled.
    // If the context is canceled, the stream will be canceled.
    func (s *Stream) Results(next func(b []byte) error) (err error) {
    	done := false
    	defer func() {
    		if s.cancel != nil {
    			s.cancel(err)
    		}
    
    		if !done {
    			// Drain channel.
    			for range s.responses {
    			}
    		}
    	}()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Feb 28 18:05:18 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  5. cmd/namespace-lock.go

    // LockContext lock context holds the lock backed context and canceler for the context.
    type LockContext struct {
    	ctx    context.Context
    	cancel context.CancelFunc
    }
    
    // Context returns lock context
    func (l LockContext) Context() context.Context {
    	return l.ctx
    }
    
    // Cancel function calls cancel() function
    func (l LockContext) Cancel() {
    	if l.cancel != nil {
    		l.cancel()
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/connection/RoutePlanner.kt

        fun connectTcp(): ConnectResult
    
        fun connectTlsEtc(): ConnectResult
    
        fun handleSuccess(): RealConnection
    
        fun cancel()
    
        /**
         * Returns a plan to attempt if canceling this plan was a mistake! The returned plan is not
         * canceled, even if this plan is canceled.
         */
        fun retry(): Plan?
      }
    
      /**
       * What to do once a plan has executed.
       *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/CancelCall.kt

        val startNanos = System.nanoTime()
        val call = client.newCall(request)
    
        // Schedule a job to cancel the call in 1 second.
        executor.schedule({
          System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f)
          call.cancel()
          System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f)
        }, 1, TimeUnit.SECONDS)
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/connection/ConnectPlan.kt

            else -> Socket(route.proxy)
          }
        this.rawSocket = rawSocket
    
        // Handle the race where cancel() precedes connectSocket(). We don't want to miss a cancel.
        if (canceled) {
          throw IOException("canceled")
        }
    
        rawSocket.soTimeout = socketReadTimeoutMillis
        try {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  9. internal/dsync/drwmutex_test.go

    	drwm1 := NewDRWMutex(ds, "simplelock")
    	ctx1, cancel1 := context.WithCancel(context.Background())
    	if !drwm1.GetRLock(ctx1, cancel1, id, source, Options{Timeout: time.Second}) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	drwm2 := NewDRWMutex(ds, "simplelock")
    	ctx2, cancel2 := context.WithCancel(context.Background())
    	if !drwm2.GetRLock(ctx2, cancel2, id, source, Options{Timeout: time.Second}) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/CancelCall.java

        final long startNanos = System.nanoTime();
        final Call call = client.newCall(request);
    
        // Schedule a job to cancel the call in 1 second.
        executor.schedule(() -> {
          System.out.printf("%.2f Canceling call.%n", (System.nanoTime() - startNanos) / 1e9f);
          call.cancel();
          System.out.printf("%.2f Canceled call.%n", (System.nanoTime() - startNanos) / 1e9f);
        }, 1, TimeUnit.SECONDS);
    
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 12 03:31:36 GMT 2019
    - 2.1K bytes
    - Viewed (0)
Back to top