Created
November 25, 2012 08:27
-
-
Save reusee/4142839 to your computer and use it in GitHub Desktop.
l
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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