agent
agent copied to clipboard
Agent is an attempt at modelling Go-like concurrency, in Ruby
I'm not sure this code, this is correct? ``` #! /usr/bin/env ruby require 'agent' require 'time' require 'nokogiri' require 'open-uri' t = Time.now DIR = t.strftime('%Y-%m') Dir.mkdir(DIR) unless File.exists?(DIR) #...
- an alternative would be to stop including it in the git repo, i.e, adding Gemfile.lock to .gitignore
Receiving on a closed channel in agent will raise an error. In go it will return immediately with the zero value for the object's type and false (in the case...
The global registry for channels is a potential source of memory leaks. We could potentially special-case channels and dup them rather than marshal them so that we don't lose references...
Some objects are singletons or are virtually immutable, so there's no need to marshal them. We could potentially let users specify their own classes to ignore or specify how to...