Skip to content
Snippets Groups Projects
Select Git revision
  • 62b2e326c52bfa8a4e290b343a395fde212b5a66
  • master default protected
  • v1.23.2
  • v1.23.1
  • v1.23.0
  • v1.22.0
  • v1.21.1
  • v1.21.0
  • v1.20.3
  • v1.20.2
  • v1.20.1
  • v1.20.0
  • v1.19.4
  • v1.19.3
  • v1.19.2
  • v1.19.1
  • v1.19.0
  • v1.18.2
  • v1.18.1
  • v1.18.0
  • v1.17.0
  • v1.16.1
22 results

runnable-dummy_test.go

Blame
  • runnable-dummy.go 729 B
    // Copyright 2023 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package jobqueue
    
    import (
    	"context"
    	"sync"
    )
    
    func NewDummyRunnableFromMap(data map[string]any) (*DummyRunnable, error) {
    	return &DummyRunnable{}, nil
    }
    
    // DummyResult is a dummy result
    type DummyResult struct {
    }
    
    type DummyRunnable struct {
    	mu sync.Mutex
    }
    
    func (d *DummyRunnable) Run(_ context.Context) (RunResult[DummyResult], error) {
    	return RunResult[DummyResult]{
    		Status: ResultStatusSuccess,
    	}, nil
    }
    
    func (d *DummyRunnable) GetType() string {
    	return "dummy"
    }
    
    func (c *DummyRunnable) GetPersistence() RunnableImport {
    	c.mu.Lock()
    	defer c.mu.Unlock()
    
    	data := JSONMap{}
    
    	return RunnableImport{
    		Type: c.GetType(),
    		Data: data,
    	}
    }