Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
N
nebula
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • exchain
  • nebula
  • Repository

Switch branch/tag
  • nebula
  • op-batcher
  • rpc
  • api.go
Find file
BlameHistoryPermalink
  • Michael de Hoog's avatar
    Allow passing in ctx to Stop · d0922bff
    Michael de Hoog authored 2 years ago
    Usa separate contexts for loading L2 blocks and tx submission
    d0922bff
api.go 408 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
package rpc

import (
	"context"
)

type batcherClient interface {
	Start() error
	Stop(ctx context.Context) error
}

type adminAPI struct {
	b batcherClient
}

func NewAdminAPI(dr batcherClient) *adminAPI {
	return &adminAPI{
		b: dr,
	}
}

func (a *adminAPI) StartBatcher(_ context.Context) error {
	return a.b.Start()
}

func (a *adminAPI) StopBatcher(ctx context.Context) error {
	return a.b.Stop(ctx)
}

Replace api.go

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.