Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for RegisterStreamingHandler (0.23 sec)

  1. internal/grid/grid_test.go

    		if err != nil {
    			t.Fatal(err)
    		}
    	}
    
    	// We fake a local and remote server.
    	remoteHost := remote.HostName()
    
    	// 1: Echo
    	register := func(manager *Manager) {
    		errFatal(manager.RegisterStreamingHandler(handlerTest, StreamHandler{
    			Handle: func(ctx context.Context, payload []byte, request <-chan []byte, resp chan<- []byte) *RemoteErr {
    				for in := range request {
    					b := append([]byte{}, payload...)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 36.4K bytes
    - Viewed (0)
  2. internal/grid/manager.go

    	m.handlers.stateless[id] = &h
    	return nil
    }
    */
    
    // RegisterStreamingHandler will register a stateless handler that serves
    // two-way streaming requests.
    func (m *Manager) RegisterStreamingHandler(id HandlerID, h StreamHandler) error {
    	if !id.valid() {
    		return ErrUnknownHandler
    	}
    	if debugPrint {
    		fmt.Println("RegisterStreamingHandler: subroute:", h.Subroute)
    	}
    	if h.Subroute == "" {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  3. internal/grid/benchmark_test.go

    	errFatal(err)
    	b.Cleanup(grid.Cleanup)
    	const responses = 10
    	// Create n managers.
    	for _, remote := range grid.Managers {
    		// Register a single handler which echos the payload.
    		errFatal(remote.RegisterStreamingHandler(handlerTest, StreamHandler{
    			// Send 10x response.
    			Handle: func(ctx context.Context, payload []byte, _ <-chan []byte, out chan<- []byte) *RemoteErr {
    				for i := 0; i < responses; i++ {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  4. internal/grid/handlers.go

    func (h *StreamTypeHandler[Payload, Req, Resp]) register(m *Manager, handle func(ctx context.Context, p Payload, in <-chan Req, out chan<- Resp) *RemoteErr, subroute ...string) error {
    	return m.RegisterStreamingHandler(h.id, StreamHandler{
    		Handle: func(ctx context.Context, payload []byte, in <-chan []byte, out chan<- []byte) *RemoteErr {
    			var plT Payload
    			if h.WithPayload {
    				plT = h.NewPayload()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 09 16:58:30 UTC 2024
    - 27.7K bytes
    - Viewed (0)
  5. cmd/storage-rest-server.go

    			logger.FatalIf(storageStatVolRPC.Register(gm, server.StatVolHandler, endpoint.Path), "unable to register handler")
    			logger.FatalIf(gm.RegisterStreamingHandler(grid.HandlerWalkDir, grid.StreamHandler{
    				Subroute:    endpoint.Path,
    				Handle:      server.WalkDirHandler,
    				OutCapacity: 1,
    			}), "unable to register handler")
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 14 17:11:51 UTC 2024
    - 45.7K bytes
    - Viewed (0)
Back to top