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:
@@ -46,6 +46,20 @@ AddCallback Example
|
||||
//event.Arguments[0] Contains the channel
|
||||
});
|
||||
|
||||
Please note: Callbacks are run in the main thread. If a callback needs a long
|
||||
time to execute please run it in a new thread.
|
||||
|
||||
Example:
|
||||
|
||||
ircobj.AddCallback("PRIVMSG", func(event *irc.Event) {
|
||||
go func(event *irc.Event) {
|
||||
//event.Message() contains the message
|
||||
//event.Nick Contains the sender
|
||||
//event.Arguments[0] Contains the channel
|
||||
}(e)
|
||||
});
|
||||
|
||||
|
||||
Commands
|
||||
--------
|
||||
ircobj := irc.IRC("<nick>", "<user>") //Create new ircobj
|
||||
|
||||
Reference in New Issue
Block a user