[Chicago-talk] open3 and passing large amounts of data

Steven Lembark lembark at wrkhors.com
Tue Nov 18 01:24:50 PST 2008


> I've don't think threading would help with this.
> 
> Thanks. I will have to look into doing non-blocking IO then.
> 
> I am still a bit lost as to why when I was trying to duplicate it on
> the shell that and I cated the test message I was using through spamc
> it went through with out being cut off.

You can block, just not on the I/O. Use
select to write, say, 8K chunks into the
pipe and check for reads on stderr. There
are a few good packages for handling this
situation, I like Graham Barr's IO::Select.

You originally mentioned a mailserver, so
there may be some message being sent from
there that blocks the spam handler. Using
select w/ timeouts will detect this in
most cases.

-- 
Steven Lembark                                            85-09 90th St.
Workhorse Computing                                 Woodhaven, NY, 11421
lembark at wrkhors.com                                      +1 888 359 3508


More information about the Chicago-talk mailing list