Implement basic queue, where is it impossible to run two identical job
in parallel
This commit is contained in:
parent
8259aaa474
commit
af96f82831
4 changed files with 81 additions and 4 deletions
24
queue.go
Normal file
24
queue.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/nemunaire/minifaas/engine"
|
||||
"github.com/nemunaire/minifaas/engine/docker"
|
||||
)
|
||||
|
||||
func FilterRunningContainers(jobtype string) (ret []string, err error) {
|
||||
ctrs, errr := docker.PsName()
|
||||
if errr != nil {
|
||||
return nil, errr
|
||||
}
|
||||
|
||||
return engine.FilterRunningContainers(jobtype, ctrs), nil
|
||||
}
|
||||
|
||||
func CountRunningContainers(jobtype string) (n int, err error) {
|
||||
ctrs, errr := docker.PsName()
|
||||
if errr != nil {
|
||||
return 0, errr
|
||||
}
|
||||
|
||||
return engine.CountRunningContainers(jobtype, ctrs), nil
|
||||
}
|
||||
Reference in a new issue