Exercises, examples and other material relating to training module R112. This topic is presented on public courses Learning to program in Ruby
, Ruby Programming
|Articles and tips on this subject||updated|
|3156||Splitting data reading code from data processing code - Ruby|
An iterator (a.k.a. generator in Python) is a function which returns its results as it calculates them, rather than building them up into a larger structure to return all at once when the function is completed. So where you have a big flow of incoming data, you can handle it as it arrives rather than ...
|2979||Ruby - yield; parallel routines|
When you call a function / method in your program, you expect it to run to completion before returning control to you, passing back a result. For example, you might call a method to read a series of objects and store them into an array ... and then you could take that array of objects and, iterating ...
Examples from our training material
|faucet|| a series of methods in a production line|
|lynes.rb|| How to write and use an iterator|
|papo|| yield - calling back to a code block|
|tap|| Reading a file in parallel to processing|
|ytb.rb|| Your own data iterator|
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from http://www.training-notes.co.uk
Topics covered in this module
Parallel assigments. Yield.
Threads, the thread scheduler and thread exceptions.
Thread critical, Mutex and Condition variables.
Spawning processes and controlling children.
Allowing your children to go independent.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.