Browse Source

En cours de développement

master
losyme 2 months ago
parent
commit
d935593948
  1. 14
      internal/demo/demo.go
  2. 17
      internal/demo/jw.go

14
internal/demo/demo.go

@ -19,11 +19,11 @@ type Demo struct {
}
func New(namespace string, logger *logger.Component, model runner.Model) (*Demo, error) {
runner := runner.New(namespace, model)
r := runner.New(namespace, model)
cfg := &workers.Config{
PoolSize: _workerPoolSize,
Runner: runner,
Runner: r,
Logger: newWorkersLogger(logger),
}
@ -36,6 +36,16 @@ func New(namespace string, logger *logger.Component, model runner.Model) (*Demo,
Workers: workers,
}
handlers := map[string]func(*runner.Job){
"succeeded": demo.succeeded,
}
for jt, jh := range handlers {
if err := r.AddJobHandler(jt, runner.JHF(jh)); err != nil {
return nil, err
}
}
return demo, nil
}

17
internal/demo/jw.go

@ -0,0 +1,17 @@
/*
------------------------------------------------------------------------------------------------------------------------
####### dune ####### Copyright (c) 2021 losyme ##################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package demo
import "forge.chapril.org/dune/sdk/runner"
func (d *Demo) succeeded(_ *runner.Job) {
// nothing to do
}
/*
######################################################################################################## @(°_°)@ #######
*/
Loading…
Cancel
Save