archipelago 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/TODO +14 -8
  2. data/lib/archipelago/disco.rb +14 -1
  3. metadata +2 -2
data/TODO CHANGED
@@ -1,16 +1,22 @@
1
1
 
2
- * Create a new HashishProvider with built in redundancy,
3
- for example using the Chord project: http://pdos.csail.mit.edu/chord/
2
+ * Create a failover/redundancy framework
3
+ * For example: Create a new HashishProvider with built in redundancy,
4
+ for example using the Chord project: http://pdos.csail.mit.edu/chord/
5
+ * Or: Create migration methods that move objects between Chests opon
6
+ startup and shutdown, and make them keep backups at each others
7
+ persistence backends.
4
8
 
5
9
  * Make Chest aware about whether transactions have affected it 'for real' ie
6
10
  check whether the instance before the call differs from the instance after
7
11
  the call. Preferably without incurring performance lossage.
8
-
9
- * Make Dubloon proxy targets able to provide a dirty_state method that decides
10
- whether they are to be considered dirty, clean or auto-select.
12
+ * For example: Make Dubloon proxy targets able to provide a dirty_state
13
+ method that decide whether they are to be considered dirty, clean or auto-select.
11
14
 
12
15
  * Test the transaction recovery mechanism of Chest.
13
16
 
14
- * Make Archipelago::Treasure::Dubloons work after an Archipelago::Treasure::Chest
15
- has rebooted. For example: demand that the chest always run the same host+port
16
- or make Dubloons able to lookup their home Chest by service_id.
17
+ * Create a memcached-starter that publishes the address to the started memcached
18
+ instance on the Disco network.
19
+
20
+ * Create a memcached-client that uses Disco instance to find all memcached instances
21
+ in the network and distribute requests among them.
22
+
@@ -409,7 +409,9 @@ module Archipelago
409
409
  @unicast_address = "#{HOST}:#{this_port}"
410
410
 
411
411
  @sender = UDPSocket.new
412
- @sender.connect(options[:address] || ADDRESS, options[:port] || PORT)
412
+ @multiaddress = options[:address] || ADDRESS
413
+ @multiport = options[:port] || PORT
414
+ @sender.connect(@multiaddress, @multiport)
413
415
 
414
416
  @unisender = UDPSocket.new
415
417
  end
@@ -530,9 +532,17 @@ module Archipelago
530
532
  recipient, data = @outgoing.pop
531
533
  if recipient
532
534
  address, port = recipient.split(/:/)
535
+ if $DEBUG
536
+ puts "sending to #{address}:#{port}:"
537
+ puts Marshal.dump(data)
538
+ end
533
539
  @unisender.send(Marshal.dump(data), 0, address, port.to_i)
534
540
  else
535
541
  begin
542
+ if $DEBUG
543
+ puts "broadcasting to #{@multiaddress}:#{@multiport}:"
544
+ puts Marshal.dump(data)
545
+ end
536
546
  @sender.write(Marshal.dump(data))
537
547
  rescue Errno::ECONNREFUSED => e
538
548
  retry
@@ -554,6 +564,9 @@ module Archipelago
554
564
  loop do
555
565
  begin
556
566
  @incoming << Marshal.load(@listener.recv(1024))
567
+ rescue ArgumentError => e
568
+ # An ArgumentError here means that the data describes a class we dont know anything
569
+ # about, which we just have to ignore.
557
570
  rescue Exception => e
558
571
  puts e
559
572
  pp e.backtrace
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: archipelago
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.2.3
7
- date: 2006-11-29 00:00:00 +01:00
6
+ version: 0.2.4
7
+ date: 2006-12-02 00:00:00 +01:00
8
8
  summary: A set of tools for distributed computing in ruby.
9
9
  require_paths:
10
10
  - lib