Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for h1 (6.98 sec)

  1. internal/grid/grid_test.go

    	remote := grid.Managers[1]
    
    	// 1: Echo
    	h1 := NewSingleHandler[*testRequest, *testResponse](handlerTest, func() *testRequest {
    		return &testRequest{}
    	}, func() *testResponse {
    		return &testResponse{}
    	})
    	// Handles incoming requests, returns a response
    	handler1 := func(req *testRequest) (resp *testResponse, err *RemoteErr) {
    		resp = h1.NewResponse()
    		*resp = testResponse{
    			OrgNum:    req.Num,
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 30 15:03:35 GMT 2024
    - 30.1K bytes
    - Viewed (0)
  2. internal/grid/connection.go

    func (c *Connection) shouldConnect() bool {
    	// The remote should have the opposite result.
    	h0 := xxh3.HashString(c.Local + c.Remote)
    	h1 := xxh3.HashString(c.Remote + c.Local)
    	if h0 == h1 {
    		return c.Local < c.Remote
    	}
    	return h0 < h1
    }
    
    func (c *Connection) send(ctx context.Context, msg []byte) error {
    	select {
    	case <-ctx.Done():
    		// Returning error here is too noisy.
    		return nil
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
Back to top