gohook/extern.go
htmk e5d15765a1 Part 1 of supporting async events
made the dispatch process send events via json through a channel (the c kind), made another function that receives it and sends it trough another channel (the go kind)

todo: remove usage of function-local data trough channel
todo:find error that is causing the c channel to fill up?
2019-02-08 14:39:24 -02:00

21 lines
299 B
Go

package hook
/*
// #include "event/hook_async.h"
*/
import "C"
import "time"
//export go_send
func go_send(s *C.char) {
str := C.GoString(s)
ev <- str
}
//export go_sleep
func go_sleep(){
//todo: find smallest time that does not destroy the cpu utilization
time.Sleep(time.Millisecond*50)
}