[16:18:47]
hays_:
hey can someone help me with a pattern? I want to have a class where I define an error handler, e.g. onError { |e| ... } and then I call that error handler whenever I feel like I need do with argument e

[16:40:16]
hays_:
what is the shortest way to create an Exception class? I want to do it at the begginning of my class definition and its just derived from standarderror. Do I need two lines to do this?

[16:40:43]
hays_:
RIght now all I am using this for is to give the exception a different name, so that I can identify it as a unique error

[16:41:42]
hays_:
class Foo < StandardException / end is the shortest I've found today, but I could have sworn there was a one-liner

[22:41:54]
g105b:
Hi I'm trying to run gem install sass and I get this error: The last version of ffi (< 2, >= 0.5.0) to support your Ruby & RubyGems was 1.9.18. I'm running Windows 10 Pro, followed instructions on http://sass-lang.com/install "The fastest way to get Ruby on your Windows computer is to use Ruby Installer (http://rubyinstaller.org/)"

[22:50:41]
bawNg:
on the off chance that anyone here ever needs to reduce the overhead of calling a proc from a C extension, I got it down to around 1us by digging through the internals and using rb_vm_invoke_proc directly

[22:53:50]
bawNg:
I'm prototyping a scheduler which needs to be able to fire timer callbacks as accurately as possible, getting the calling overhead down to about 1us allows the reactor thread to wake up and fire the timer with more precision than sleeping in a native ruby thread

[23:02:14]
conceivably:
Hello, I'm writing a Ruby class that will only have one public method 'run'. How do I decide what belongs into 'initialize' and what should be done in 'run'? Both of them will be called whenever the class is used.

[23:21:05]
eam:
so generally when you're using select() to multiplex i/o to sockets (and or do other things in the meantime) you're going to want to construct a state machine that looks like

[23:21:12]
conceivably:
Radar: Well there is almost no code to show yet, since I was trying to decide where to start putting it (but perhaps this is the wrong approach?). The class is a 'Report' that is initialized with some input, grabs some things from a database, makes an api call, and finally produces a more or less deeply nested hash as a result of calling run. So it seesm to me that constructing the hash should go into 'run'. But what about retrieving

[23:40:24]
eam:
yeoman: you can either multiplex within a single thread, or do a thread-per-connection model

[23:40:39]
eam:
(or some hybrid variation thereof when you get very high performance)

[23:41:54]
eam:
I have a kinda simple example of multiplexing multiple connections here, if you wanna take a look. It's very much *not* abstracted so hopefully it's sort of easy to piece apart https://github.com/square/mssh/blob/master/lib/mcmd.rb

[23:42:16]
eam:
it's somewhat of a mess, this was one of the first things I wrote when I came back to ruby after about a decade away from it

[23:43:00]
eam:
in this case it's multiplexing pipes to subprocesses, but the mechanism is more or less the same