Sha256: 3c051b848795db52359ab7df39f6e4a70da72c6755ea2af5e1661488a7331e0d
Contents?: true
Size: 607 Bytes
Versions: 12
Compression:
Stored size: 607 Bytes
Contents
require 'rubygems' require 'test/unit' require File.dirname(__FILE__) + "/../lib/mailbox" class ChannelBasedLogger include Mailbox def initialize(log_channel) register_channel :log_channel, log_channel end mailslot :channel => :log_channel def log(message) p "Logging on Thread #{Thread.current.object_id} - #{message}" end end class ChannelBasedLogExample < Test::Unit::TestCase def test_log_example channel = JRL::Channel.new logger = ChannelBasedLogger.new channel p "Current Thread is #{Thread.current.object_id}" channel.publish "some log message" end end
Version data entries
12 entries across 12 versions & 1 rubygems