Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,957 for closeFn (0.12 sec)

  1. pkg/test/echo/server/forwarder/http.go

    			QUICConfig:      &quic.Config{},
    		}
    	}
    	closeFn := func(conn *http3.RoundTripper) func() {
    		return func() {
    			_ = conn.Close()
    		}
    	}
    	noCloseFn := func() {}
    
    	if cfg.newConnectionPerRequest {
    		// Create a new transport (i.e. connection) for each request.
    		return func() (http.RoundTripper, func(), error) {
    			conn := newConn()
    			return conn, closeFn(conn), nil
    		}, noCloseFn
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 30 13:56:46 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  2. pkg/log/config.go

    		allLoggers = append(allLoggers, &grpcLogger)
    	}
    
    	closeFns := make([]func() error, 0)
    
    	for _, ext := range options.extensions {
    		for _, logger := range allLoggers {
    			newLogger, closeFn, err := ext(*logger)
    			if err != nil {
    				return err
    			}
    			*logger = newLogger
    			closeFns = append(closeFns, closeFn)
    		}
    	}
    
    	pt := patchTable{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Mar 26 20:38:10 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. guava/src/com/google/common/io/Closer.java

     *
     * <pre>{@code
     * Closer closer = Closer.create();
     * try {
     *   InputStream in = closer.register(openInputStream());
     *   OutputStream out = closer.register(openOutputStream());
     *   // do stuff
     * } catch (Throwable e) {
     *   // ensure that any checked exception types other than IOException that could be thrown are
     *   // provided here, e.g. throw closer.rethrow(e, CheckedException.class);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/io/Closer.java

     *
     * <pre>{@code
     * Closer closer = Closer.create();
     * try {
     *   InputStream in = closer.register(openInputStream());
     *   OutputStream out = closer.register(openOutputStream());
     *   // do stuff
     * } catch (Throwable e) {
     *   // ensure that any checked exception types other than IOException that could be thrown are
     *   // provided here, e.g. throw closer.rethrow(e, CheckedException.class);
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  5. src/database/sql/sql_test.go

    	if !waitCondition(t, func() bool {
    		rows.closemu.RLock()
    		defer rows.closemu.RUnlock()
    		return rows.closed
    	}) {
    		t.Fatal("failed to close rows")
    	}
    }
    
    // TestQueryContextWait ensures that rows and all internal statements are closed when
    // a query context is closed during execution.
    func TestQueryContextWait(t *testing.T) {
    	db := newTestDB(t, "people")
    	defer closeDB(t, db)
    	prepares0 := numPrepares(t, db)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
  6. internal/http/close.go

    )
    
    // DrainBody close non nil response with any response Body.
    // convenient wrapper to drain any remaining data on response body.
    //
    // Subsequently this allows golang http RoundTripper
    // to reuse the same connection for future requests.
    func DrainBody(respBody io.ReadCloser) {
    	// Callers should close resp.Body when done reading from it.
    	// If resp.Body is not closed, the Client's underlying RoundTripper
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/CloserTest.java

        Closer closer = new Closer(suppressor);
    
        TestCloseable c1 = closer.register(TestCloseable.normal());
        TestCloseable c2 = closer.register(TestCloseable.normal());
    
        IOException exception = new IOException();
    
        try {
          try {
            throw exception;
          } catch (Throwable e) {
            throw closer.rethrow(e);
          } finally {
            closer.close();
          }
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  8. src/net/http/httptest/server.go

    	// wg counts the number of outstanding HTTP requests on this server.
    	// Close blocks until all requests are finished.
    	wg sync.WaitGroup
    
    	mu     sync.Mutex // guards closed and conns
    	closed bool
    	conns  map[net.Conn]http.ConnState // except terminal states
    
    	// client is configured for use with the server.
    	// Its transport is automatically closed when Close is called.
    	client *http.Client
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:26:10 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/io/CharSink.java

        checkNotNull(charSequence);
    
        Closer closer = Closer.create();
        try {
          Writer out = closer.register(openStream());
          out.append(charSequence);
          out.flush(); // https://code.google.com/p/guava-libraries/issues/detail?id=1330
        } catch (Throwable e) {
          throw closer.rethrow(e);
        } finally {
          closer.close();
        }
      }
    
      /**
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Feb 28 20:13:02 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  10. src/database/sql/sql.go

    	// and exclusively during close.
    	//
    	// closemu guards lasterr and closed.
    	closemu sync.RWMutex
    	lasterr error // non-nil only if closed is true
    	closed  bool
    
    	// closemuScanHold is whether the previous call to Scan kept closemu RLock'ed
    	// without unlocking it. It does that when the user passes a *RawBytes scan
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
Back to top