8000 Message, rather than event · aaronjensen/messaging-postgres@94d158e · GitHub
[go: up one dir, main page]

Skip to content

Commit 94d158e

Browse files
committed
Message, rather than event
1 parent 92263c7 commit 94d158e

File tree

11 files changed

+29
-29
lines changed

11 files changed

+29
-29
lines changed

test/automated/write/batch/no_id.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
context "Individual Events are Written" do
1717
2.times do |i|
18-
read_event = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
18+
read_message = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
1919

2020
context "Assigns an ID" do
2121
test "Event #{i + 1}" do
22-
refute(read_event.id.nil?)
22+
refute(read_message.id.nil?)
2323
end
2424
end
2525
end

test/automated/write/batch/write.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
context "Individual Events are Written" do
1616
2.times do |i|
17-
read_event = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
17+
read_message = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
1818

1919
test "Event #{i + 1}" do
20-
assert(read_event.data[:some_attribute] == values[i])
20+
assert(read_message.data[:some_attribute] == values[i])
2121
end
2222
end
2323
end

test/automated/write/batch/write_initial.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
context "Write" do
44
context "Batch" do
5-
context "Writing the initial event to a stream that has not been created yet" do
5+
context "Writing the initial message to a stream that has not been created yet" do
66
stream_name = Controls::StreamName.example
77

88
batch, values = Controls::Batch.example
@@ -13,16 +13,16 @@
1313

1414
context "Individual Events are Written" do
1515
2.times do |i|
16-
read_event = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
16+
read_message = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
1717

1818
test "Event #{i + 1}" do
19-
assert(read_event.data[:some_attribute] == values[i])
19+
assert(read_message.data[:some_attribute] == values[i])
2020
end
2121
end
2222
end
2323
end
2424

25-
context "Writing the initial event to a stream that already exists" do
25+
context "Writing the initial message to a stream that already exists" do
2626
stream_name = Controls::StreamName.example
2727

2828
batch = Controls::Batch::Messages.example

test/automated/write/batch/write_with_reply_stream.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
context "Individual Events are Written" do
1414
2.times do |i|
15-
read_event = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
15+
read_message = MessageStore::Postgres::Get.(stream_name, position: i, batch_size: 1).first
1616

1717
test "Event #{i + 1}" do
18-
assert(read_event.data[:some_attribute] == values[i])
18+
assert(read_message.data[:some_attribute] == values[i])
1919
end
2020
end
2121
end

test/automated/write/message/no_id.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
position = Write.(message, stream_name)
1313

14-
read_event = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
14+
read_message = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
1515

1616
test "Assigns an ID" do
17-
refute(read_event.id.nil?)
17+
refute(read_message.id.nil?)
1818
end
1919
end
2020
end

test/automated/write/message/reply.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
position = write.reply(message)
1414

15-
read_event = MessageStore::Postgres::Get.(reply_stream_name, position: position, batch_size: 1).first
15+
read_message = MessageStore::Postgres::Get.(reply_stream_name, position: position, batch_size: 1).first
1616

1717
test "Writes the message to the reply stream" do
18-
assert(read_event.data == message.to_h)
18+
assert(read_message.data == message.to_h)
1919
end
2020

2121
test "Clears the reply stream from the metadata" do
22-
assert(read_event.metadata[:reply_stream_name].nil?)
22+
assert(read_message.metadata[:reply_stream_name].nil?)
2323
end
2424
end
2525
end

test/automated/write/message/write.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
position = Write.(message, stream_name)
1010

11-
read_event = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
11+
read_message = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
1212

1313
test "Writes the message" do
14-
assert(read_event.data == message.to_h)
14+
assert(read_message.data == message.to_h)
1515
end
1616
end
1717
end

test/automated/write/message/write_initial.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
context "Write" do
44
context "Message" do
5-
context "Writing the initial event to a stream that has not been created yet" do
5+
context "Writing the initial message to a stream that has not been created yet" do
66
stream_name = Controls::StreamName.example
77

88
message = Controls::Message.example
@@ -11,14 +11,14 @@
1111

1212
write.initial(message, stream_name)
1313

14-
read_event = MessageStore::Postgres::Get.(stream_name, position: 0, batch_size: 1).first
14+
read_message = MessageStore::Postgres::Get.(stream_name, position: 0, batch_size: 1).first
1515

1616
test "Writes the message" do
17-
assert(read_event.data == message.to_h)
17+
assert(read_message.data == message.to_h)
1818
end
1919
end
2020

21-
context "Writing the initial event to a stream that already exists" do
21+
context "Writing the initial message to a stream that already exists" do
2222
stream_name = Controls::StreamName.example
2323

2424
message = Controls::Message.example

test/automated/write/message/write_with_reply_stream.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
position = Write.(message, stream_name, reply_stream_name: reply_stream_name)
1212

13-
read_event = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
13+
read_message = MessageStore::Postgres::Get.(stream_name, position: position, batch_size: 1).first
1414

1515
test "Sets the metadata reply stream name" do
16-
assert(read_event.metadata[:reply_stream_name] == reply_stream_name)
16+
assert(read_message.metadata[:reply_stream_name] == reply_stream_name)
1717
end
1818
end
1919
end

test/interactive/consume.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
handler = Handler.build
2323

24-
MessageStore::Postgres::Read.(stream_name, batch_size: 1, cycle_maximum_milliseconds: 10, cycle_timeout_milliseconds: 2000) do |event_data|
25-
logger.debug(tags: [:test, :data, :message]) { event_data.pretty_inspect }
24+
MessageStore::Postgres::Read.(stream_name, batch_size: 1, cycle_maximum_milliseconds: 10, cycle_timeout_milliseconds: 2000) do |message_data|
25+
logger.debug(tags: [:test, :data, :message]) { message_data.pretty_inspect }
2626

27-
message = handler.(event_data)
27+
message = handler.(message_data)
2828

2929
logger.debug(tags: [:test, :data, :message]) { "Handled message: #{message.message_type}" }
3030
logger.debug(tags: [:test, :data, :message]) { message.pretty_inspect }

test/interactive/measure.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040

4141
consumer_count = 0
4242
consumer_start_time = Time.now
43-
MessageStore::Postgres::Read.(stream_name) do |event_data|
44-
consumer_logger.debug(tags: [:test, :data, :message]) { event_data.pretty_inspect }
43+
MessageStore::Postgres::Read.(stream_name) do |message_data|
44+
consumer_logger.debug(tags: [:test, :data, :message]) { message_data.pretty_inspect }
4545

46-
message = handler.(event_data)
46+
message = handler.(message_data)
4747
consumer_count += 1
4848

4949
consumer_logger.debug(tags: [:test, :data, :message]) { "Handled message: #{message.message_type}" }

0 commit comments

Comments
 (0)
0