BREAKING CHANGES: Run callbacks in main thread and int callback id.

Execute callbacks in main thread. This will break callbacks that
use a long time to execute. Create your own thread in AddCallback
using gorutines on long running callbacks.

Use deterministic IDs for AddCallback. Changes the id from SHA-hash
to int.
This commit is contained in:
Thomas Jager
2016-02-06 21:33:04 +01:00
parent ab737c68eb
commit da78ed515c
4 changed files with 64 additions and 52 deletions

View File

@@ -33,7 +33,7 @@ type Connection struct {
nickcurrent string //The nickname we currently have.
user string
registered bool
events map[string]map[string]func(*Event)
events map[string]map[int]func(*Event)
QuitMessage string
lastMessage time.Time