Skip to content
Snippets Groups Projects
collector.go 482 B
Newer Older
  • Learn to ignore specific revisions
  • package core
    
    import (
    	"fmt"
    )
    
    // A Collector schedules the execution of various Jobs.
    type Collector struct {
    	// The Importer we forward the ULO/RDF bytes to.
    	im Importer
    
    	// Collection of all ever sumbmitted jobs. Aquire
    	// mu before accessing this collection.
    
    func (c *Collector) Submit(j *Job) error {
    
    	if _, loaded := c.jobs.LoadOrStore(id, j); loaded {
    		return fmt.Errorf("Id=%v already submitted", id)