MEChat 1.2.2 → 1.2.5.pre.pause

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/Chat.rb +8 -0
  3. data/client.rb +1 -1
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df9c8aad3c6f17a909439a15eb05e47ee866ba66e812ef2146ad22d2b7bf1eae
4
- data.tar.gz: ba2fc4b2a0bc150e711ed8adc3781a89babc2a59b913a60a63f5c72990303211
3
+ metadata.gz: bf2ec999b660eded80cb27be27389b5f5ed3cdbbb9413c794e349bfe743d6ec4
4
+ data.tar.gz: 9c33f89aabb6acc8e801c833947c4c4cc917990a98fb63d9ce077e861f473fcf
5
5
  SHA512:
6
- metadata.gz: fb245e1baa6c763ef1aa4f5516d1ce41addc39a4ca2edc636cef7a165b6643fa0c54d0de814d1ce61d481dda019baeecf857d1c1cc7358dfec3fdac58e41fc4c
7
- data.tar.gz: 486bc3b6b00de1f9646cb770d162d67f6b5517b12f73d9dd8c59b3b8700c399f26345ce624c4d79607dff701a8cac70cf69f6f9ab8363dee18dbb7b23ef476b1
6
+ metadata.gz: 90018a9598629f8e7af04f2a874a715ef9fa4bd38e93194683edd7cd7f57fc6829384aefec9b260b4a7f093542067dd1e0b3056960a61c4152cfb01fbf8affc8
7
+ data.tar.gz: 279a0a25e925d743405863dcbf68e392a579d469e2bb6d28b85a55a90dc66140ce7985c13fc3af08014779bf91df954c3a177aa054a780d304fdd3e4a53bc7be
data/Chat.rb CHANGED
@@ -41,6 +41,14 @@ class Chat < DistributedChat::ChatService::Service
41
41
  elsif $crit_section < 2 && request[:message].timestamp < $alg.clock
42
42
  @logger.info "Sent reply to #{request[:ip].ip_address}:#{request[:ip].ip_port}, because I am entering critical section but my request is newer"
43
43
  send_reply ip: request[:ip]
44
+ elsif $crit_section < 2 && request[:message].timestamp === $alg.clock
45
+ if request[:ip].ip_address + ":" + request[:ip].ip_port.to_s < @ip.ip_address + ":" + @port.to_s
46
+ @logger.info "Sent reply to #{request[:ip].ip_address}:#{request[:ip].ip_port}, because I am entering critical section but my request is newer"
47
+ send_reply ip: request[:ip]
48
+ else
49
+ @logger.info "Delayed reply to #{request[:ip].ip_address}:#{request[:ip].ip_port}, because I am entering critical section but my request is older"
50
+ $alg.requests << request
51
+ end
44
52
  else
45
53
  @logger.info "Delayed reply to #{request[:ip].ip_address}:#{request[:ip].ip_port}, because I am in critical section"
46
54
  $alg.requests << request
data/client.rb CHANGED
@@ -72,9 +72,9 @@ class Client
72
72
  request_critical_section
73
73
  while $alg.replies.length < $nodes.length
74
74
  sleep 0.1
75
- @logger.info "#{@ip.ip_address}:#{$port.to_s} #{$alg.replies.length}/#{$nodes.length} waiting for replies"
76
75
  end
77
76
  $crit_section = 2
77
+ gets
78
78
  $nodes.each do |node|
79
79
  chat = DistributedChat::ChatService::Stub.new("#{node.address}:#{node.port}", :this_channel_is_insecure)
80
80
  chat.send_message(DistributedChat::Request.new(username: "#{@ip.ip_address}:#{$port.to_s}", message: new_msg, timestamp: $alg.clock))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MEChat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.5.pre.pause
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Kaufmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc
@@ -140,9 +140,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - ">"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 1.3.1
146
146
  requirements: []
147
147
  rubygems_version: 3.4.10
148
148
  signing_key: