From: Francis Joanis Date: 2004-06-05T22:53:38+09:00 Subject: Re: Transfering files using drb (distributed Ruby) On Sat, 5 Jun 2004 05:46:04 +0900, Joel VanderWerf wrote: > Kirk Haines wrote: >> On Sat, 5 Jun 2004 00:33:39 +0900, Francis Joanis wrote >> >>> Hello everyone, >>> >>> I'd like to know if it is possible to use drb to transfer files from >>> the server to the client (and vice versa)? >>> >>> For example, a remotely callable method could return a byte array >>> then, client side, that array could be written back on disk. >>> >>> If this is possible, how would the drb infrastructure "behave" when >>> transfering rather big arrays (say, 5~10 megabytes)? >> >> >> It's definitely possible. As to have the infrastructure behaves, you >> will have processing costs because the data has to be marshalled for >> transfer and then unmarshalled at the other end. I regularly pump >> hundreds of k per second of marshalled data around though, with no >> problems. >> >> I'd say just try it. DRb is extremely simple to use. Put a prototype >> together and test it out! > > And if the file just gets slurped into a string, the marshalling cost > will be next to nothing. > > irb(main):002:0> str = (1..9).entries.to_s*10 > => > "123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789" > irb(main):003:0> Marshal.dump(str) > => > "\004\010\"_123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789" > > Thanks guys, I'm going to try it out and give you some news. FJ