Ruby on Rails, Io, Lisp, JavaScript, Dynamic Languages, Prototype-based programming and more...

Technoblog reader special: $10 off web hosting by FatCow!

Wednesday, August 23, 2006

More Advanced Starfish Feature

I promised you in Dynamically Add Methods to Classes Through their Objects in Ruby that there was a good use for that idea coming up. The time has come to show you how to use it.

server do |map_reduce|
map_reduce.type = File
map_reduce.input = "some_file_name.txt"

map_reduce.process = lambda do |text|

map_reduce.finished = lambda do

client do |line|
if line =~ /some_regular_expression/

Notice how I am dynamically adding methods to map_reduce in the server declaration. I define the process and finished methods. The process method is called from the client via server.process and the finished method is called when the collection has been fully processed.

Astute readers will notice that being able to dynamically add server side helper methods does a non-distribtued version of reduce (from MapReduce), which is good enough for many real world situations. Enjoy!

You should follow me on twitter here.

Technoblog reader special: click here to get $10 off web hosting by FatCow!


Anonymous Jeff said...

This was asked in a previous post but never answered, so I'm going to ask it again.

In the example above, it appears to have a file as input to process.

Let's say that file contains a listing of unique e-mail addresses. The e-mail addresses are to persons that you want to send an e-mail message to.

How does Starfish prevent multi-processes sending multiple e-mail messages to the same unique e-mail address found in the input text file?

In other words, how does Starfish prevent an e-mail address found in the text input file from receiving more than one e-mail message?

1:21 PM, August 23, 2006

Blogger Lucas Carlson said...

It uses a queue system, so two clients can never grab the same line from a file because once grabbed, that line is not accessible to any other clients. It also has a simple mutex to prevent two calls at the exact same time.

1:25 PM, August 23, 2006

Anonymous Jeff said...


Does Starfish wait for the results of each line to process before dispatching the next "line" to be processed?

Or does it read in all the lines, queues them up and then dispatches each line to be processed. This is with the understanding that some "lines" might take a shorter amount of time to process than others and thus - the results are returned to the dispatcher out of order. If this is the case, would you mind explain how Starfish handles this case since sometime you might need to know the results of line 1 before line 2

1:38 PM, August 23, 2006

Anonymous Wayne said...


How is Starfish different than using Mongrel with regards to HTTP requests?

1:40 PM, August 23, 2006

Blogger Lucas Carlson said...

Starfish reads in all the lines, queues them up and then dispatches each line to be processed. In the case where you might need to know the results of line 1 before line 2, you would have to add a server helper method for that logic, since it is very possible line 200 might be processed before line 199.

1:51 PM, August 23, 2006

Anonymous KirinDave said...

What's so confusing about the reddit complaints is that they don't really make sense given the context. Ruby is all about using component libraries to speed up individual tasks through C. Ruby has a fantastic interface for this

Saying, "Abandon Ruby, use C for numerical computation" is basically saying, "Use Ruby and a good library like Narray or Ruby/GSL, but write 4x the code."

2:32 PM, August 25, 2006

Anonymous Anonymous said...

what do you think about backgroudrb compared with starfish?

1:10 AM, March 28, 2007

Blogger Lai Weizhou said...

chung cư tháp doanh nhân
tháp doanh nhân / tháp doanh nhân hà đông / dự án tháp doanh nhân hà đông / chung cư the legend / chung cư the legend 109 nguyễn tuân
chung cư 360 giải phóng / dự án 360 giải phóng / chung cư vietracimex / chung cư 201 minh khai / chung cư thanh xuân tower / chung cư 35 lê văn thiêm
chung cư eco green city / chung cu eco green city / chung cư eco green city nguyễn xiển / chung cu eco green city nguyen xien / eco green city / eco green city nguyễn xiển / dự án eco green city / toà ct4 eco green city / toà ct3 eco green city / toà ct1 eco green city

11:08 AM, May 21, 2016

Anonymous Anonymous said...

hermes outlet
ferragamo outlet
swarovski outlet
coach outlet online
toms shoes
ray-ban sunglasses
beats headphones
coach outlet online
mulberry handbags
chaussure louboutin
tory burch outlet online
cheap ray ban sunglasses
ray ban sunglasses
louis vuitton neverfull
michael kors wholesale
true religion outlet
mont blanc pens
cheap football shirts
kate spade handbags
mulberry bags
gucci outlet online
cheap jordans
nfl jersey wholesale
ralph lauren outlet
rolex watches for sale
tory burch outlet online
christian louboutin shoes
mulberry handbags
true religion jeans sale
true religion uk outlet
christian louboutin outlet
lebron james shoes
coach outlet
nike blazer pas cher
longchamp pliage

6:18 PM, May 30, 2016

Blogger Hua Cai said...

ugg boots sale
coach outlet online
cheap replica watches
burberry outlet
hollister clothing store
adidas uk
kobe 9 elite
jordan shoes
herve leger outlet
lebron shoes
ferragamo shoes
lebron james shoes
nike roshe run
nike air max 90
michael kors wallet sale
louis vuitton bags
cheap jordan shoes
tiffany jewelry
fitflops uk
michael kors handbags
longchamp bag
cartier sunglasses for men
lululemon outlet
jordan pas cher
futbol baratas
oakley sunglasses
ugg outlet
celine outlet
swarovski crystal
ray ban sunglasses
true religion uk outlet
versace sunglasses on sale
true religion outlet
cheap oakley sunglasses

10:40 PM, August 03, 2016

Blogger chenmeinv0 said...

ralph lauren outlet
michael kors outlet
cleveland cavaliers jerseys
mont blanc ballpoint pen
cheap rolex watches
true religion jeans
cheap uggs
prada handbags
ray ban sunglasses outlet
louis vuitton outlet

10:23 PM, January 03, 2017

Blogger Unknown said...

ferragamo shoes
los angeles lakers
michael kors handbags
michael kors outlet
oakley sunglasses
nike store
michael kors outlet
michael kors handbags sale
49ers jersey
gucci borse

12:33 AM, March 16, 2017

Blogger shengda xu said...

adidas yeezy boost
adidas nmd r1
coach outlet store online
louis vuitton outlet online
burberry sale
burberry outlet
adidas yeezy boost
coach outlet online
coach factory outlet online

6:37 AM, April 18, 2017

Blogger Quang Đào Duy said...

Tọa lạc tại vị trí đắc địa Chung cư 378 Minh Khai được mệnh danh là " Viên Ngọc" giữa lòng thành phố với vị trí không thể thuận tiện hơn tại nút giao thông huyết mạch nối liền các trung tâm Chính trị, Văn hóa,Trường học, Bệnh viện, Sân gold của thủ đô Hà Nội

Dự án Green Pearl tọa lạc tại số 378 Minh Khai , Hai Bà Trưng, Hà Nội là một vị trí đắc địa thuộc cửa ngõ phía Nam của Thủ đô, nơi tập trung các tuyến giao thông huyết mạch của TP Hà Nội (Đường Minh Khai - Cầu Vĩnh Tuy). Dự án bao gồm nhà ở liền kề, biệt thự và căn hộ cao cấp Green Pearl mở ra không gian sống xanh, trong lành, KHÔNG ồn ào, KHÔNG khói bụi ngay trong lòng đô thị.

Dự án 378 Minh Khai hiểu rõ vui chơi là hình thức tốt nhất giúp trẻ phát triển tư duy. Từ đó chúng tôi xây dựng trường học hiện đại, khu vui chơi trẻ em với những trò vui chơi giải trí, trí tuệ giúp trẻ phát triển cả tư duy sáng tạo và thể chất.

Chung cư Green Pearl
Chung cư Green Pearl Không chỉ là giải pháp đáp ứng nhu cầu nhà ở chất lượng cao, sứ mệnh của Green Pearl là cùng bạn trải nghiệm cuộc sống" bình yên trọn vẹn "tách biệt với cuộc sống ngột ngạt ồn ào bên ngoài. Không gian yên tĩnh trong lành được khai thác tối đa trên những con đường tản bộ xanh mát sẽ giúp bạn cảm thấy thư thái nhằm tái tạo năng lượng hiệu quả nhất.
Mặt bằng chung cư Green Pearl
Tiện ích chung cư Green Pearl
Giá bán chung cư Green Pearl
Chung cư Green Pearl

8:19 PM, January 12, 2018

Anonymous Cara menyembuhkan gerd said...

may be useful for all, helpful article once and pardon me permission to share also here :

Obat herbal flek paru paru ampuh
Obat perih ulu hati
Cara mengatasi mimisan
Obat darah tersumbat
Obat lambung perih
Cara mengatasi gatal payudara
Obat benjolan di leher ampuh

7:37 PM, May 23, 2018

Blogger Deden Hidayat said...

thank you very useful information admin, and pardon me permission to share articles here may help :

Obat klep jantung bocor herbal
Obat tumor jinak tanpa operasi

8:22 PM, June 07, 2018

Anonymous Cara menyembuhkan ispa said...

given article is very helpful and very useful for my admin, and pardon me permission to share articles here hopefully helped :

Obat endometriosis
Obat tulang retak
Obat gangguan fungsi hati
Cara menyembuhkan vertigo
Cara mengatasi eksim
Obat lambung bengkak
Cara mengobati cacar air

8:26 PM, July 19, 2018

Blogger Inma Maulana said...

Hello, I am from a health blog admin, I want to share the latest articles from us, among them is

Pengobatan Alami Untuk Penyakit Kulit
Pengobatan Alami Untuk Penyakit Ginjal
Biaya Operasi Untuk Pengangkatan Tumor
Obat Tipes Alami
Cara Alami Mengatasi Eksim Basah
Cara Mengatasi Rematik Pada Lansia

9:11 PM, July 24, 2018

Anonymous Cara menghilangkan bekas jerawat said...

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article

cara menghilangkan bekas jerawat
Tips Membersihkan Kulit Wajah dari Jerawat Batu
Cara menghilangkan benjolan di leher
Cara Mengobati Pengapuran Tulang
Cara Ampuh Mengatasi Sering Kencing Diabetes Penyebab Diabetes
Cara Menyembuhkan Kanker Laring
Cara Menghilangkan Kista Coklat
Cara Mengobati Radang Hati

6:24 PM, July 26, 2018

Blogger Quang Đào Duy said...

Vincity Gia Lâm
Vincity Ocean Park
Vincity Ocean Park Gia Lâm
Tiện ích Vincty ocean Park
Mặt bằng vincity Ocean Park
Giá bán Vincity Ocean Park
Thiết kế vincity Ocean Park Gia Lâm
Vinhomes Ocean Park
Liền kề Oean Park
Biệt thự Vinhomes Ocean Park
Shophouse Vinhomes Ocean Park
Biệt thự Ocean Park
Vincity Đại Mỗ
Vincity Tây Mỗ

2:08 AM, September 13, 2018

Blogger risa icha said...

Hi, This Information is incredible ^_^ I want to work with you in the health sector :

obat batuk berdarah
obat infeksi saluran kencing
cara mengobati kencing nanah
obat cacar air

1:42 AM, September 17, 2018

Blogger Lutfi Kurniawan said...

Salute for your writing, dreams are something that is sure to get tomorrow, if we always pray and work.

Cara Mengatasi Nyeri Tulang Dan Sendi Paling Ampuh
Cara Alami Menghilangkan Rasa Perih Pada Lambung
Cara Mengempiskan Kaki Bengkak Akibat Penyakit Ginjal
Obat Kelenjar Getah Bening Di Leher

12:19 AM, October 09, 2018

Blogger Ya Rohman said...

Given article is very helpful and very useful for me, thank you

Cara Mengobati Kaligata Tips Menyembuhkan Patah Tulang Obat Kanker Payudara Obat Bisul Alami

11:37 PM, November 28, 2018

Blogger نور الهدى said...

رش مبيدات بالمدينة المنورة رش مبيدات بالمدينة المنورة
رش مبيدات بالدمام رش مبيدات بالدمام
مكافحة الحمام بالمدينة المنورة مكافحة الحمام بالمدينة المنورة

9:03 AM, December 08, 2018

Blogger eric yao said...

Coach Factory Coach Factory Outlet Coach Outlet Online Fila Outlet Balenciaga Shoes Cheap Kate Spade Handbag Kate Spade Outlet Air Max Tn Plus Nike Air Max
Victoria Secret Outlet

11:31 PM, January 22, 2019

Blogger samaher said...

اننا نقدم ارخص اسعار نقل العفش فى الدمام التى تتميز عن غيرها باننا نعمل على استخدام افضل نجارين فك وتغليف بالاضاف الى افضل سيارات نقل العفش واسعار هى الارخص لاننا
ارخص شركة نقل عفش بالدمام
ودائما عندما تحتاج الى نقل العفش اتصل على ارقامشركة نقل عفش بالدماملتحظى بافضل خدمة لا مثيل لها

2:40 PM, January 27, 2019

Blogger Sarah Betty said...

I just want to say thanks for your wonderful post, it is contain a lot of knowledge and information that i needed right now. Thanks!

"Choose the games completely rely on the client, because they choose the game according to preference, attention and their mood of the game. Facets like formula, color concept and structure of the game also sways the players’ decision. Games like Miragine Battle Friv are for youths that are daring. With amazing turns friv has indicated the scuffle enjoyment within this game."
Also you can play varios juegos friv en línea

1:57 AM, February 03, 2019

Blogger Ahmed Hamdy said...

أرقام وأثمان مؤسسات مكافحة الحشرات
عميلنا العزيز إذا كنت تسعي للتخلص من الحشرات التي قد تتواجد بمنزلك أو بمصنعك أو بشركتك أو أي موضع تتواجد به فكل ما عليك القيام به هو التواصل بشركتنا فسوف تجد لدينا كل ما تتمناه من خدمات قد تحتاجها.
فلدينا من الخبرة ما يجعلنا الأجود من ضمن بقية المؤسسات، كما يبقى لدينا فريق من المتخصصين والفنين والعمال المدربين على أيدي أمهر المتخصصين العالمين في أسلوب التداول مع جميع أشكال الحشرات، كما لدينا من المبيدات والأدوات أفضلها شركة مكافحة النمل الابيض بالقصيم
شركة مكافحة حشرات بالقصيم
شركة رش مبيدات بالقصيم
شركة الانوار لمكافحة الحشرات

1:40 PM, February 14, 2019

Blogger Hema Refai said...

شركة تنظيف خزانات بالرياض
شركة تنظيف مكيفات بالرياض

2:58 PM, February 24, 2019

Blogger Hằng VT said...

I am very interested in this post, everyone should know it more, wish you success. The author of this post is admirable, it brings a lot of emotion to everyone reading it, let's share it more widely.
free friv Games 2019, jogos io online, abcya 10, cá koi mini

7:51 AM, August 06, 2019

Blogger meldaresearch said...

Unsure which firm produces Best Research Paper Help Online in the writing industry? Legitimate Research Paper Help Services is there for you for the best Research Paper Help Assistance Services.

2:00 AM, December 13, 2019


Post a Comment

Subscribe to Post Comments [Atom]

<< Home


If you like this blog, you might also like top photography schools.