[Swift-devel] Streams
Mihael Hategan
hategan at mcs.anl.gov
Tue May 1 13:57:37 CDT 2012
On Tue, 2012-05-01 at 13:52 -0500, Tim Armstrong wrote:
> My instinct is that if you wanted to do this in Swift, then the right
> way would be to model a stream as a variable in the same way as files.
> Swift would be responsible for hooking up applications to different
> streams... You can't do this in current Swift, I'm guessing it would
> need major extensions
Not really. The arrays already work that way (as Ben points out). What
is needed is an external notification mechanism (i.e. something to tell
Swift when a new file comes in - in other words that an array got a new
element). That's easy conceptually.
The more difficult part is, and Ben also points that out, the "garbage
collection" issue. I.e. the ability to process an infinite number of
objects in a loop without running out of resources.
More information about the Swift-devel
mailing list