stack package - github.com/rocketlaunchr/igo/stack - Go Packages (original) (raw)
v1.0.3 Published: Apr 6, 2020 License: MIT
Documentation¶
This section is empty.
This section is empty.
This section is empty.
Stack is used to stores closures in order.
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 (s *Stack) Add(goroutine bool, fn interface{})
Add inserts a closure to the stack.
Unwind executes all stored closures from the beginning to the end.