dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.1.0
postmodern has quit [Quit: Leaving]
xeviox|afk is now known as xeviox
quaxim has quit [*.net *.split]
quaxim has joined #cinch
quaxim has quit [Ping timeout: 252 seconds]
quaxim has joined #cinch
thews has quit [Read error: Connection reset by peer]
thews has joined #cinch
thews has joined #cinch
xeviox is now known as xeviox|afk
lagweezle has quit [Quit: leaving]
lagweezle has joined #cinch
lagweezle has quit [Changing host]
lagweezle has joined #cinch
<Paradox> dominikh activerecord 4 seems to love cinch just fine
<Paradox> none of the thread errors i got on 3
<dominikh> Paradox: interesting. some person reported issues with AR some days ago; but I have no idea which version he was using
<Paradox> i used a thread pool
<Paradox> but maybe mine worked because i designed it to be concurrent
<dominikh> well, his issue boiled down to not being able to automatically return to the pool
<Paradox> didnt use the writers in the individual command threads
<Paradox> but rather wrote a mutex on them
<Paradox> so maybe thats why
<dominikh> ah.
<Paradox> it was a simple test bot too
<Paradox> nothing complex
<Paradox> just a qdb
<Paradox> but thats the same sort of thing i had to do with datamapper
<Paradox> it screamed if i tried to directly call models
<dominikh> in the end it'll always boil down to a thread pool or a single mutexed connection, anyway
<Paradox> yup
<Paradox> i've also found that while, in theory you could get 2 people running commands in the same exact milisecond
<Paradox> in practice, it almost never happens
<Paradox> usually you get one person running a command
<Paradox> which triggers 3 or 4 people running them
<Paradox> and then dies down
<dominikh> depends what you base the timestamp on ;) receival of the message? it will happen. scheduling of the thread? probably not. I don't see how timestamps equal the equation though
<Paradox> see also, memebot, which doesn't use a db but still needs a mutex
<dominikh> s/equal/enter
<Paradox> not timestamps, just an observation on why blocking might not be terrible
<Paradox> i mean, cinch is already threaded
<Paradox> you're not gonna miss new messages because you block one of the command threads
<dominikh> depends on how long running the query takes ;)
<Paradox> on bad days for imgur we've had memes take 5 minutes to make with memebot
<dominikh> re whether it matters. but no, you won't miss messages
<Paradox> < user> !meme lol;xd
<Paradox> < user> where's my meme
<Paradox> < user> :(
<Paradox> 5 minutes later
<Paradox> < memebot> user: http://i.imgur.com/memeurl.jpg
<dominikh> if you get enough people spam your bot, however, you'll manage to spawn enough threads to either OOM or hit the set limits :)
<dominikh> and heh
<Paradox> interestingly enough, thats never happened, even with a stress testing bot i wrote
<Paradox> bots that respond to any message
<Paradox> we spin up a few hundred of them
<Paradox> then let them loose on a channel on a new server
<dominikh> well, if the threads finish quickly, it's unlikely to happen (on IRC). if each command invocation takes minutes to complete, however, ...
<Paradox> yeah
<Paradox> i can understand that
<dominikh> in retrospect I might've wanted to put a semaphore around thread creation…
<dominikh> but as you said, nobody has complained so far.
<Paradox> why fix whats not broken
<Paradox> heh
<dominikh> because it's shameful code and I know better? ;)
<dominikh> but I'd have to rewrite quite a bit of Cinch if I cared about that
<Paradox> this is where the shame scale is useful
<Paradox> does the shame outweigh the effort it takes to fix it?
<Paradox> :p
<dominikh> hehe
<Paradox> i've found the answer is almost always no
<Paradox> unless i come into some old codebase
<Paradox> and its someone else's shame
<Paradox> then i can rewrite it
<dominikh> another part of the scale is "will other people even realise it's bad code?"
<dominikh> in the case of Cinch… probably not ;)
<Paradox> lately i've been writing up a lot of dumb bits of code
<Paradox> and then people ask them for me
<Paradox> er
<Paradox> ask me for them
<Paradox> i used to freak out and try to clean it up and run it through rubocop and stuff
<Paradox> now i just stuff it up in github and say "here it is, it was done in a single evening, enjoy"
<dominikh> haha, yeah… I have code like that. usually simple "proof of concepts" of something I wanted to check out
<Gizmokid2005> dominikh: like the cinch irc client? :)
<dominikh> haha, yeah, for example that
<Gizmokid2005> I ran across that looking for cinch things and got a chuckle out of it.
<Paradox> http://github.com/paradox460/memebot is my most popular shit code thing
<dominikh> that's not even the right use of that meme :P
<dominikh> you're a terrible person
<Paradox> its random if you dont specify the meme
<dominikh> well, that… fits better
<Paradox> if you have an irc client with inline images
<Paradox> its pretty fun
<dominikh> if you have an irc client with inline images, you're either a madman or very careful about the channels you join.
<Paradox> or have a high tolerance for shit
<Paradox> :p
<dominikh> which gets you quite close to madman ;)
<dominikh> that meme abuse really makes me sick :P
<Paradox> well the bot initially came out of a bet in a circlejerk channel
<Paradox> someone made a dumb bad meme on imgur
<Paradox> and then i said i bet i could come up with a way to make even dumber, worse memes
<dominikh> haha
<Paradox> they said you're on and put down 28 bucks
<Paradox> i won
<dominikh> :D
<Gizmokid2005> Paradox: did you get your $28?
<Paradox> yes
<Gizmokid2005> w00!
<Gizmokid2005> I've got a channel my bot is in and the guys are pretty great trying to put it into infinite loops, causing it to rm -rf, excute sudo commands, etc
<Gizmokid2005> it's pretty great.
<Gizmokid2005> I'm going to give you lots of credit dominikh - Cinch is superbly resilient
<dominikh> it's not at all resilient to bad code that would even allow them to execute system commands, though ;)
<Gizmokid2005> that's true. as long as I don't give it bad code, the base of cinch is pretty great
<dominikh> yup
<Paradox> one of our network ops who is trying to teach themselves ruby wanted a bot that ran fortune
<Paradox> i told him i wouldnt let his bots on the network without being able to test them
<Paradox> it ran fortune by doing `fortune #{x}`
<dominikh> oh come on…
<dominikh> teach that man about stdin :P
<Paradox> i pointed him to the billions of ways ruby has to run commands
<dominikh> and exploits, and shell injection, and security, and ...
<Paradox> he eventually went with process.spawn
<Paradox> which works much better
<Gizmokid2005> I've got a lot to learn, but using cinch is making it super fun.
<dominikh> Gizmokid2005: it's funny, I don't even use Cinch, or Ruby, anymore
<onewheelskyward> Go go dominikh
<Gizmokid2005> dominikh: honestly, that doesn't even surprise me. It seems that a lot of these projects start out as something that's useful/fun and then you just...stop needing it and don't worry about it anymore.
<Gizmokid2005> Just like #overviewer. All of the devs of that project no longer play minecraft, but they still work on the project that is the google maps rendering of Minecraft maps.
<dominikh> yeah. interests change.
<Gizmokid2005> That they do.
postmodern has joined #cinch