Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 649 Bytes

CONTRIBUTING.md

File metadata and controls

33 lines (24 loc) · 649 Bytes

Compiling

$ glide install
$ go build -o scat ./cmd

Running all tests:

$ tools/test

Writing a new proc

  • delegator: a(b) calls b, filters its results

    In a.Process():

     // ...do things before
     ch := b.Process(c)    // within current goroutine
     out := make(chan Res) // after ch
     go func() {
       defer close(out)
       // ...consume ch
     }()
     return out

    In a.Finish(): must call b.Finish()

    When either a.Process() or a.Finish() (or both) does nothing else than delegating to b, then a should be a struct that embeds Proc to inherit those methods and benefit from implicit delegation.