Skip to content
Snippets Groups Projects
Select Git revision
  • ef8ef78c5168be8cbd886118caf298c828338fb4
  • master default protected
  • 1.31
  • 4.38.8
  • 4.38.7
  • 4.38.6
  • 4.38.5
  • 4.38.4
  • 4.38.3
  • 4.38.2
  • 4.38.1
  • 4.38.0
  • 4.37.2
  • 4.37.1
  • 4.37.0
  • 4.36.0
  • 4.35.0
  • 4.34.1
  • 4.34.0
  • 4.33.1
  • 4.33.0
  • 4.32.2
  • 4.32.1
23 results

README.md

Blame
  • runnable.go 536 B
    // Copyright 2023 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package jobqueue
    
    import (
    	"context"
    )
    
    type ResultStatus int
    
    const (
    	ResultStatusSuccess ResultStatus = iota
    	ResultStatusFailed
    )
    
    type RunGenericResult interface {
    	GetStatus() ResultStatus
    }
    
    type RunResult[T any] struct {
    	Status ResultStatus
    	Data   T
    }
    
    func (r RunResult[T]) GetStatus() ResultStatus {
    	return r.Status
    }
    
    type Runnable[T any] interface {
    	Run(ctx context.Context) (RunResult[T], error)
    	GetType() string
    	GetPersistence() RunnableImport
    }