Created
June 16, 2009 23:11
-
-
Save jmhodges/130970 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ReverseGeoThread < Thread; end | |
| class ListingThread < Thread; end | |
| def run | |
| cj = caller.join | |
| if cj =~ /reverse_geo/ | |
| klass = ReverseGeoThread | |
| elsif cj =~ /listings/ | |
| klass = ListingThread | |
| else | |
| klass = Thread | |
| end | |
| klass.new { | |
| # a bunch of stuff | |
| } | |
| end | |
| # old version | |
| def run | |
| cj = caller.join | |
| if cj =~ /reverse_geo/ | |
| klass = ReverseGeoThread | |
| elsif cj =~ /listings/ | |
| klass = ListingThread | |
| end | |
| Thread.new { | |
| # a bunch of stuff | |
| } | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment