ChanServ changed the topic of #cinch to: The IRC Framework | http://groups.google.com/group/cinch-ruby/ | Latest version: Cinch 2.0.4 – Change log at http://bit.ly/14Q4s6Z – Migration guide at http://bit.ly/GO4qkW | This channel is being publicly logged at http://irclog.whitequark.org/cinch/
v0n has quit [Ping timeout: 255 seconds]
v0n has joined #cinch
jonahR_ has joined #cinch
jonahR has quit [Ping timeout: 252 seconds]
jonahR_ is now known as jonahR
jonahR has quit [Quit: jonahR]
v0n has quit [Ping timeout: 252 seconds]
v0n has joined #cinch
v0n has quit [Ping timeout: 276 seconds]
jonahR has joined #cinch
caitlinface has joined #cinch
caitlinface has left #cinch ["Linkinus - http://linkinus.com"]
sleetdrop has joined #cinch
exoa is now known as ex0a
jhaals has joined #cinch
jonahR has quit [Quit: jonahR]
jhaals has quit [Quit: jhaals]
Spami has joined #cinch
Spami has joined #cinch
jhaals has joined #cinch
jhaals has quit [Client Quit]
jhaals has joined #cinch
jhaals has quit [Client Quit]
sleetdrop has quit [Ping timeout: 264 seconds]
sleetdrop has joined #cinch
Spami has quit [Quit: This computer has gone to sleep]
postmodern has quit [Quit: Leaving]
ex0a has quit [Ping timeout: 245 seconds]
jhaals has joined #cinch
ex0a has joined #cinch
Spami has joined #cinch
Spami has quit [Ping timeout: 248 seconds]
jhaals has quit [Quit: jhaals]
Spami has joined #cinch
Spami has joined #cinch
v0n has joined #cinch
Spami has quit [Quit: This computer has gone to sleep]
jhaals has joined #cinch
sleetdrop has quit [Quit: Textual IRC Client: www.textualapp.com]
jhaals has quit [Quit: jhaals]
jonahR has joined #cinch
jhaals has joined #cinch
jhaals has quit [Quit: jhaals]
Spami has joined #cinch
Spami has joined #cinch
sleetdrop has joined #cinch
sleetdrop has quit [Max SendQ exceeded]
sleetdrop has joined #cinch
sleetdrop has quit [Max SendQ exceeded]
sleetdrop has joined #cinch
Spami has quit [Quit: Leaving]
sleetdrop has quit [Quit: Computer has gone to sleep.]
cout has quit [Ping timeout: 260 seconds]
cout has joined #cinch
<nickrw> is it possible to access an instance of another plugging running in the same bot?
<dominikh> yes.
<nickrw> so fiddling about I found bot.plugins
<dominikh> right
<nickrw> is there a built in way I'm missing to find a particular one, or should I just do something like bot.plugins.find_index { |x| x.class == My::Plugin }
<nickrw> to pick mine from the array
<dominikh> nope, that's pretty much it
<nickrw> cool
postmodern has joined #cinch
<nickrw> is it possible to block on all handler threads triggered by bot.handlers.dispatch?
<dominikh> nickrw: what exactly do you mean?
<nickrw> I'm making some changes to a game I wrote a while ago, and I'm trying to keep features of it modular. Each feature is a cinch plugin, and until now I've used bot.handlers.dispatch(:some_event) to have them cooperate
<nickrw> which has been fine because none of the events outside the main plugin have needed to write state anywhere
<dominikh> so you want to wait for the threads spawned by dispatch to finish?
<nickrw> yes
<dominikh> let me take a look if there's anything in the public API that'd make this possible
<dominikh> for what it's worth, each handler has its own thread group, but HandlerList#dispatch won't tell you which handlers it just ran, and you wouldn't know which threads in the thread group belong to which invocation
<nickrw> yeah, I'm looking at the code for #dispatch just now
<dominikh> so no, there's currently nothing in the API allowing that. it's doable in a couple lines though
<dominikh> Handler#call would need to return a thread, HandlerList#dispatch would need to collect them and return a list
<dominikh> I might not even object to a patch adding that to Cinch, unless I can think of an issue with that.
<nickrw> hm
<nickrw> dominikh: something like http://pastebin.com/bEWbU9pv ?
<dominikh> nickrw: I'd probably use a plain Array, not a Set, but yeah.
<dominikh> s/probably// – I'd definitely use an array
<dominikh> there's no possible way to end up with duplicate threads
<nickrw> ah, yes
<nickrw> I'll test my plugins against patched cinch and if it works well I'll send a pull request
<dominikh> alright
<dominikh> nickrw: while you're at it, pull line 42 (based on your last pastebin) out of the if. we want an empty array if there's nothing to run, not a nil
<nickrw> ok
v0n has quit [Ping timeout: 252 seconds]
<nickrw> proof-of-concept plugin seems to do what I expect http://pastebin.com/7ef2Qvg5
<dominikh> nickrw: how does Thread#join behave if the thread in question already ended?
<nickrw> it returns self
<nickrw> you only get an exception if you try to Thread#run / Thread#wakeup a finished thread
<dominikh> ah, okay
<nickrw> I'm not sure how it behaves if the thread died with an exception though
<nickrw> testing that
<nickrw> yeah, the exception gets raised in the joiner
<dominikh> mhm. ah well, it's your plugins, make them solid ;)
<nickrw> heh
<nickrw> github is down, perfect timing :D
<dominikh> works here
<dominikh> but there's been a general hiccup in some routes
<nickrw> and up again
<dominikh> nickrw: will look into it after this movie :)
<nickrw> thanks :)
<nickrw> no rush, I'm happy working off my locally modified gem for now
<dominikh> heh yeah. I won't be pushing a new release for that yet, either
<dominikh> so you'd need to build from master, either way