Skip to content

Instantly share code, notes, and snippets.

@tarcieri
Created December 21, 2011 20:39
Show Gist options
  • Save tarcieri/1507597 to your computer and use it in GitHub Desktop.
Save tarcieri/1507597 to your computer and use it in GitHub Desktop.
Kilim "Hello World" with Mirah
# Adapted from https://github.com/kilim/kilim/blob/master/examples/kilim/examples/SimpleTask.java
import "kilim.Mailbox"
import "kilim.Pausable"
import "kilim.Task"
class ExampleTask < Task
def initialize
@mailbox = Mailbox.new
end
def mailbox
@mailbox
end
def execute
while true
str = @mailbox.get
break if str == "done"
puts str
end
end
end
task = ExampleTask(ExampleTask.new.start)
exit_mb = Mailbox.new
task.informOnExit exit_mb
task.mailbox.putnb "Hello "
task.mailbox.putnb "World\n"
task.mailbox.putnb "done"
puts exit_mb.getb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment