Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

type Stack struct {
	sync.Mutex
	// contains filtered or unexported fields
}

    Stack is used to stores closures in order.

    func NewStack

    func NewStack(lifo bool, capacity ...int) *Stack

      NewStack creates a new Stack. lifo will make the stack operate in "LIFO" mode. Otherwise it will operate in "FIFO" mode. For fordefer, LIFO is required.

      func (*Stack) Add

      func (s *Stack) Add(goroutine bool, fn interface{})

        Add inserts a closure to the stack.

        func (*Stack) Unwind

        func (s *Stack) Unwind()

          Unwind executes all stored closures from the beginning to the end.

          Source Files