Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for subroute (0.18 sec)

  1. internal/grid/README.md

        err := manager.RegisterStreamingHandler(grid.HandlerDiskInfo, StreamHandler{
            Handle: handler,
            Subroute: "asubroute",
            OutCapacity: 1,
            InCapacity: 1,
        })
    ```
    
    Sample call:
    ```go
        // Get a connection to the remote host
        conn := manager.Connection(host).Subroute("asubroute")
    	
        payload := []byte("request")
        stream, err := conn.NewStream(ctx, grid.HandlerDiskInfo, payload)
    Plain Text
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  2. internal/grid/trace.go

    		TraceType: madmin.TraceInternal,
    		Prefix:    "grid",
    		Local:     c.Local,
    		Remote:    c.Remote,
    		Subroute:  "",
    	}
    }
    
    // subroute adds a specific subroute to the request.
    func (c *tracer) subroute(subroute string) *tracer {
    	if c == nil {
    		return nil
    	}
    	c2 := *c
    	c2.Subroute = subroute
    	return &c2
    }
    
    type tracer struct {
    	Publisher *pubsub.PubSub[madmin.TraceInfo, madmin.TraceType]
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 22:54:54 GMT 2024
    - 4K bytes
    - Viewed (0)
  3. internal/grid/handlers.go

    		// Any non-nil error sent as response means no more responses are sent.
    		Handle StreamHandlerFn
    
    		// Subroute for handler.
    		// Subroute must be static and clients should specify a matching subroute.
    		// Should not be set unless there are different handlers for the same HandlerID.
    		Subroute string
    
    		// OutCapacity is the output capacity. If <= 0 capacity will be 1.
    		OutCapacity int
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.9K bytes
    - Viewed (0)
  4. internal/grid/connection.go

    	}
    	return c
    }
    
    // Subroute returns a static subroute for the connection.
    func (c *Connection) Subroute(s string) *Subroute {
    	if c == nil {
    		return nil
    	}
    	return &Subroute{
    		Connection: c,
    		route:      s,
    		subID:      makeSubHandlerID(0, s),
    		trace:      c.trace.subroute(s),
    	}
    }
    
    // Subroute adds a subroute to the subroute.
    // The subroutes are combined with '/'.
    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)
  5. internal/grid/manager.go

    // []byte -> ([]byte, error) requests.
    // subroutes are joined with "/" to a single subroute.
    func (m *Manager) RegisterSingleHandler(id HandlerID, h SingleHandlerFn, subroute ...string) error {
    	if !id.valid() {
    		return ErrUnknownHandler
    	}
    	s := strings.Join(subroute, "/")
    	if debugPrint {
    		fmt.Println("RegisterSingleHandler: ", id.String(), "subroute:", s)
    	}
    
    	if len(subroute) == 0 {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  6. internal/grid/benchmark_test.go

    					toSend = append(toSend, payload...)
    					select {
    					case <-ctx.Done():
    						return nil
    					case out <- toSend:
    					}
    				}
    				return nil
    			},
    
    			Subroute:    "some-subroute",
    			OutCapacity: 1, // Only one message buffered.
    			InCapacity:  0,
    		}))
    		errFatal(err)
    	}
    	const payloadSize = 512
    	rng := rand.New(rand.NewSource(time.Now().UnixNano()))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 12.2K bytes
    - Viewed (0)
  7. internal/grid/muxserver.go

    }
    
    func newMuxStream(ctx context.Context, msg message, c *Connection, handler StreamHandler) *muxServer {
    	var cancel context.CancelFunc
    	ctx = setCaller(ctx, c.remote)
    	if len(handler.Subroute) > 0 {
    		ctx = setSubroute(ctx, handler.Subroute)
    	}
    	if msg.DeadlineMS > 0 {
    		ctx, cancel = context.WithTimeout(ctx, time.Duration(msg.DeadlineMS)*time.Millisecond+c.addDeadline)
    	} else {
    		ctx, cancel = context.WithCancel(ctx)
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  8. internal/grid/muxclient.go

    	if err != nil {
    		return err
    	}
    	if msg.Flags&FlagSubroute != 0 {
    		if m.subroute == nil {
    			return fmt.Errorf("internal error: subroute not defined on client")
    		}
    		hid := m.subroute.withHandler(msg.Handler)
    		before := len(dst)
    		dst = append(dst, hid[:]...)
    		if debugPrint {
    			fmt.Println("Added subroute", hid.String(), "to message", msg, "len", len(dst)-before)
    		}
    	}
    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)
  9. internal/grid/msg.go

    	FlagPayloadIsErr
    
    	// FlagPayloadIsZero means that payload is 0-length slice and not nil.
    	FlagPayloadIsZero
    
    	// FlagSubroute indicates that the message has subroute.
    	// Subroute will be 32 bytes long and added before any CRC.
    	FlagSubroute
    )
    
    // This struct cannot be changed and retain backwards compatibility.
    // If changed, endpoint version must be bumped.
    //
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 28 19:22:29 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  10. internal/grid/grid_test.go

    					Embedded:  *i,
    				}
    				n++
    			}
    			return nil
    		}, "subroute", "1"))
    	}
    	register(local)
    	register(remote)
    
    	// local to remote
    	remoteConn := local.Connection(remoteHost)
    	const testPayload = "Hello Grid World!"
    	// Add subroute
    	remoteSub := remoteConn.Subroute(strings.Join([]string{"subroute", "1"}, "/"))
    
    	start := time.Now()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 08 18:15:27 GMT 2024
    - 30.1K bytes
    - Viewed (0)
Back to top