Skip to content

Instantly share code, notes, and snippets.

@reusee
Created November 25, 2012 08:27
Show Gist options
  • Select an option

  • Save reusee/4142839 to your computer and use it in GitHub Desktop.

Select an option

Save reusee/4142839 to your computer and use it in GitHub Desktop.
l
package main
import (
"github.com/reusee/golua/lua"
"fmt"
"time"
)
func main() {
for n := int64(0); n < int64(1024); n++ {
n := n
l := lua.NewState()
l.OpenLibs()
l.Register("here", func (l *lua.State) int {
l.PushInteger(n)
return 1
})
go func() {
defer l.Close()
err := l.DoString("while true do print(here()) end")
if err != nil {
fmt.Printf("%v\n", err)
}
}()
}
<-time.After(time.Second * 5)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment