tuning

package module
v0.0.0-...-8249bd2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wait

func Wait()

Wait - wait for all goroutine

Types

type BaseMelody

type BaseMelody struct {
}

BaseMelody - simple Impl

func (BaseMelody) Play

func (BaseMelody) Play(t *Track, in interface{}) interface{}

Play - impl melody

type Cantor

type Cantor struct {
	MaxTrack int
	// contains filtered or unexported fields
}

Cantor - then controller

func GetCantor

func GetCantor() *Cantor

GetCantor - get cantor

type Clock

type Clock struct {
	// contains filtered or unexported fields
}

Clock - clock

func RunTrack

func RunTrack(t *Track) *Clock

RunTrack - init track

func (*Clock) After

func (c *Clock) After(d time.Duration)

After - run after

func (*Clock) Cron

func (c *Clock) Cron(spec string)

Cron - `spec` see: github.com/robfig/cron usage: (*tuning.Clock).Cron(spec) == (*cron.Cron).AddFunc(spec, callback)

func (*Clock) Immediately

func (c *Clock) Immediately()

Immediately - immediately run

func (*Clock) On

func (c *Clock) On(t time.Time) (d time.Duration)

On - run on

func (*Clock) Super

func (c *Clock) Super() *Clock

Super - switck `super` flag

type Melody

type Melody interface {
	Play(*Track, interface{}) interface{}
}

Melody - the payload of task

type Music

type Music struct {
	// contains filtered or unexported fields
}

Music - the factory of task

func NewMusic

func NewMusic() *Music

NewMusic - new factory

func (*Music) AddMainMelody

func (m *Music) AddMainMelody(melody *Melody, bufLen int) (id string)

AddMainMelody - add melody

func (*Music) AddSubMelody

func (m *Music) AddSubMelody(mainID string, melody *Melody, bufLen int) (id string, ok bool)

AddSubMelody - add & connect melody Warning: not equal to `ConnectMelody(mainID, AddMainMelody(melody))`

func (*Music) Build

func (m *Music) Build(id string) (t *Track, total int)

Build - build task chan by id

func (*Music) BuildChan

func (m *Music) BuildChan(tc *TrackChan) (t *Track, total int)

BuildChan - build task chan

func (*Music) ConnectMelody

func (m *Music) ConnectMelody(m1 string, m2 string) (ok bool)

ConnectMelody - connect melody

func (*Music) Get

func (m *Music) Get(id string) (tc *TrackChan, ok bool)

Get - get main melody

type Track

type Track struct {
	// contains filtered or unexported fields
}

Track - the task

func NewTrack

func NewTrack(m *Melody, bufLen int) *Track

NewTrack - new task

func (*Track) After

func (t *Track) After(n *Track) *Track

After - t after n

func (*Track) Before

func (t *Track) Before(n *Track) *Track

Before - t before n

func (*Track) Finish

func (t *Track) Finish()

Finish - finish task

func (*Track) Inputer

func (t *Track) Inputer(in interface{})

Inputer - input to track's in chan

func (*Track) Play

func (t *Track) Play()

Play - continue task

func (*Track) Stop

func (t *Track) Stop()

Stop - stop task

type TrackChan

type TrackChan struct {
	// contains filtered or unexported fields
}

TrackChan - track chan

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL