Documentation
¶
Index ¶
- Constants
- type Graph
- func (graph *Graph[E]) AddEdge(from, to string)
- func (graph *Graph[E]) AddVertex(name string, elem E)
- func (graph *Graph[E]) Check() error
- func (graph *Graph[E]) Optimize()
- func (graph *Graph[E]) Scheduling(interrupts iter.Seq[string], parallelismLimit int) (todo <-chan []*GraphVertex[E], done chan<- []*GraphVertex[E])
- func (graph *Graph[E]) Steps() ([][]string, []string)
- type GraphEdge
- type GraphMarshaler
- type GraphVertex
- type HasPriority
- type Mapper
- type Transaction
- type TransactionManager
- type WorkParams
- type Worker
- type WorkerCache
- type WorkerPool
Constants ¶
View Source
const ( StatusTodo = iota StatusDoing StatusDone )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph[E any] struct { Vertices map[string]*GraphVertex[E] Edges map[GraphEdge[E]]bool Heads []*GraphVertex[E] VertexSlice []*GraphVertex[E] ScheduleNum int sync.Mutex // contains filtered or unexported fields }
func MapToNewGraph ¶
func (*Graph[E]) Scheduling ¶
func (graph *Graph[E]) Scheduling(interrupts iter.Seq[string], parallelismLimit int) (todo <-chan []*GraphVertex[E], done chan<- []*GraphVertex[E])
type GraphEdge ¶
type GraphEdge[E any] struct { From *GraphVertex[E] To *GraphVertex[E] }
type GraphMarshaler ¶
type GraphMarshaler[E any] struct { Vertices map[string]E `json:"Vertices,omitempty"` Edges [][2]string `json:"Edges,omitempty"` SubGraphs map[string]*GraphMarshaler[E] `json:"SubGraphs,omitempty"` }
func NewGraphMarshaler ¶
func NewGraphMarshaler[E any](graph *Graph[E]) *GraphMarshaler[E]
func (GraphMarshaler[E]) GenerateGraph ¶
func (marshaler GraphMarshaler[E]) GenerateGraph() *Graph[E]
type GraphVertex ¶
type GraphVertex[E any] struct { Name string Status int Wait int Elem E Dependencies []*GraphVertex[E] Next []*GraphVertex[E] Group []*GraphVertex[E] Priority int }
type HasPriority ¶ added in v0.7.0
type HasPriority interface {
GetPriority() int
}
type Transaction ¶ added in v0.7.0
type Transaction struct { Manager *TransactionManager Node ogcore.Transactional }
type TransactionManager ¶ added in v0.7.0
func NewTransactionManager ¶ added in v0.7.0
func NewTransactionManager() *TransactionManager
func (*TransactionManager) CommitAll ¶ added in v0.7.0
func (manager *TransactionManager) CommitAll()
func (*TransactionManager) Manage ¶ added in v0.7.0
func (manager *TransactionManager) Manage(txNode ogcore.Transactional) *Transaction
func (*TransactionManager) PreCommit ¶ added in v0.7.0
func (manager *TransactionManager) PreCommit(tx *Transaction)
func (*TransactionManager) RollbackAll ¶ added in v0.7.0
func (manager *TransactionManager) RollbackAll()
type WorkParams ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) SetTxManager ¶ added in v0.7.0
func (worker *Worker) SetTxManager(manager *TransactionManager)
type WorkerCache ¶
func (*WorkerCache) Get ¶
func (cache *WorkerCache) Get() (*Worker, bool)
func (*WorkerCache) Put ¶
func (cache *WorkerCache) Put(worker *Worker) bool
func (*WorkerCache) Reset ¶
func (cache *WorkerCache) Reset()
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool(cacheSize int) *WorkerPool
func (*WorkerPool) Get ¶
func (pool *WorkerPool) Get() (*Worker, bool)
func (*WorkerPool) Put ¶
func (pool *WorkerPool) Put(worker *Worker)
func (*WorkerPool) Reset ¶
func (pool *WorkerPool) Reset()
Click to show internal directories.
Click to hide internal directories.