Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for slowCaller (0.06 sec)

  1. internal/cachevalue/cache_test.go

    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cachevalue
    
    import (
    	"context"
    	"errors"
    	"testing"
    	"time"
    )
    
    func slowCaller(ctx context.Context) error {
    	sl := time.NewTimer(time.Second)
    	defer sl.Stop()
    
    	select {
    	case <-sl.C:
    	case <-ctx.Done():
    		return ctx.Err()
    	}
    
    	return nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu May 09 00:51:34 UTC 2024
    - 2.7K bytes
    - Viewed (0)
Back to top