Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
664 commits
Select commit Hold shift + click to select a range
9fb65cd
Number of actors can be specified as an environment variable
sbellware Jun 5, 2018
45be726
Obsolete concurrent write script is removed
sbellware Jun 5, 2018
e2e7435
Merge branch 'concurrency-testing'
sbellware Jun 5, 2018
228cde4
Concurrent write actor is namespaced
sbellware Jun 5, 2018
23c638e
Obsolete concurrent write script is removed
sbellware Jun 5, 2018
053080c
Server function volatility is explicit
sbellware Jun 5, 2018
f935bf8
Instance variable name matches attribute name
sbellware Jun 5, 2018
1a9b04e
Obsolete position parameter is removed
sbellware Jun 5, 2018
b8083b8
Package version is increased from 0.8.0.0 to 0.9.0.0
sbellware Jun 5, 2018
08a6a9c
Benchmark defaults are in the test namespace
sbellware Jun 5, 2018
f9e6de4
Retrieval function
sbellware Jun 5, 2018
84fb916
Basic proof implementation of the get_messages Postgres server function
sbellware Jun 6, 2018
0b7acf4
Select statement is dynamic
sbellware Jun 6, 2018
2b65234
Where clause is dynamic and optional
sbellware Jun 6, 2018
f18536f
Message type
sbellware Jun 6, 2018
da37f99
Get stream messages
sbellware Jun 6, 2018
273f579
Generated SQL statement is indented for scannability
sbellware Jun 6, 2018
9ebeb9a
Tool writes messages to store
sbellware Jun 6, 2018
4e8f7d4
Sever function returns stream messages
sbellware Jun 6, 2018
7b39549
Debug message is disabled
sbellware Jun 6, 2018
25b3785
File name matches its contents
sbellware Jun 6, 2018
ca05e6f
Server function returns category messages
sbellware Jun 7, 2018
dcdcfe7
Server function get last message in a stream
sbellware Jun 7, 2018
b4d67cd
Test scripts for retrieval server functions
sbellware Jun 7, 2018
cdc93ed
Test scripts for writing message
sbellware Jun 7, 2018
82cdacd
Database test suite script
sbellware Jun 7, 2018
f2768b4
Output is not pages in database test scripts
sbellware Jun 7, 2018
e60f3a5
Data is retrieved using the Postgres server functinos
sbellware Jun 8, 2018
7d3f9d6
Script installs server functions
sbellware Jun 8, 2018
b4e4138
Spelling mistake is corrected
sbellware Jun 8, 2018
34be689
Existence of database user is not checked before creating it
sbellware Jun 8, 2018
ea9abd1
Obsolete materials are removed
sbellware Jun 8, 2018
f372a3b
Get benchmark, post retrieval server functions
sbellware Jun 8, 2018
1f2eaf8
Vestigial file is removed
sbellware Jun 8, 2018
42784c1
Merge branch 'retrieval-server-functions'
sbellware Jun 8, 2018
1b8a90c
Date is corrected
sbellware Jun 8, 2018
d71b207
Database artifacts are removed to the message_store-postgres-database…
sbellware Jun 8, 2018
11b9bae
Package version is increased from 0.9.0.0 to 0.10.0.0
sbellware Jun 8, 2018
0f413c1
Test does not accidentally cause uniqueness violation by writing the …
sbellware Jun 25, 2018
88f9dbb
Merge branch 'category-name'
sbellware Jun 25, 2018
58b68d8
Benchmark result for ID index unique constraint
sbellware Jun 25, 2018
a0827d8
Sql command logging is tagged with :sql rather than :data
sbellware Jul 13, 2018
5cf3539
Package version is increased from 0.10.0.0 to 0.10.0.1
sbellware Jul 13, 2018
ce671a5
Vestigial comment is removed
sbellware Jul 13, 2018
3cbe478
Session open is an alias for connect
sbellware Jul 13, 2018
3d7f797
Package version is increased from 0.10.0.1 to 0.10.1.0
sbellware Jul 13, 2018
91e46c0
Override settings file path with MESSAGE_STORE_SETTINGS_PATH environm…
sbellware Jul 15, 2018
d3c355e
Package version is increased from 0.10.1.0 to 0.10.2.0
sbellware Jul 15, 2018
31626c2
Writer logs list of types written
sbellware Jul 16, 2018
85d6e5e
Package version is increased from 0.10.2.0 to 0.10.2.1
sbellware Jul 16, 2018
230bb2c
Logging
sbellware Jul 16, 2018
2eeab9b
Package version is increased from 0.10.2.1 to 0.10.2.2
sbellware Jul 16, 2018
7453435
load_path.rb is updated with the latest version
sbellware Aug 14, 2018
be82426
Ruby description is included in benchmark output
sbellware Sep 5, 2018
2c7dd1a
Session test file names are clarified
sbellware Sep 27, 2018
88706f5
Session configuration also receives settings
sbellware Sep 27, 2018
892c6e7
Merge branch 'session-configuration-with-settings'
sbellware Sep 27, 2018
3841550
Package version is increased from 0.10.2.2 to 0.10.3.0
sbellware Sep 27, 2018
4032e79
Session and settings test coverage is increased
sbellware Oct 3, 2018
e2c188e
Merge branch 'session-construction-and-configuration-test'
sbellware Oct 3, 2018
53c10ed
Settings macro is no longer activated when loading code
ntl Oct 9, 2018
f7b0582
Package version is increased from 0.10.3.0 to 0.11.0.0
ntl Oct 9, 2018
91aae43
Dependency macro is no longer expected to have been loaded
ntl Oct 9, 2018
396845e
Package version is increased from 0.11.0.0 to 0.11.0.1
ntl Oct 9, 2018
933143e
Settings::Setting module is included instead of deprecated Settings.a…
ntl Oct 12, 2018
19f2bb6
Package version is increased from 0.11.0.1 to 0.11.0.2
ntl Oct 12, 2018
966da1e
Libraries with activations are included
ntl Oct 12, 2018
fd22da5
Package version is increased from 0.11.0.2 to 0.11.0.3
ntl Oct 12, 2018
15a1846
Read's default batch size is Get's default batch size
sbellware Oct 24, 2018
26c425e
Package version is increased from 0.11.0.3 to 0.11.1.0
sbellware Oct 24, 2018
1aa3030
Benchmarks for text column
sbellware Oct 29, 2018
4352293
Library-level log tags reduced to 'message_store'
sbellware Nov 3, 2018
6b67754
Package version is increased from 0.11.1.0 to 0.11.1.1
sbellware Nov 3, 2018
4d2a454
Link to documentation site
sbellware Nov 3, 2018
c1829bf
Log tags are standardized
sbellware Nov 3, 2018
d1c7f4c
Package version is increased from 0.11.1.1 to 0.11.1.2
sbellware Nov 3, 2018
5a8fdd7
Log tags are standardized
sbellware Nov 3, 2018
cb1c46e
Package version is increased from 0.11.1.2 to 0.11.1.3
sbellware Nov 3, 2018
1959d46
Log tags are standardized
sbellware Nov 3, 2018
47a94dc
Package version is increased from 0.11.1.3 to 0.11.1.4
sbellware Nov 3, 2018
adbd711
Package version is increased from 0.11.1.4 to 1.0.0.0
ntl Nov 4, 2018
c707e7c
Connection status check is protected when nil
sbellware Jan 18, 2019
9f897ea
Package version is increased from 1.0.0.0 to 1.0.0.1
sbellware Jan 18, 2019
d0e7c74
Benchmarks are updated, and results files include the Ruby description
sbellware Feb 6, 2019
556fc23
Machine information is included in the new benchmark results
sbellware Feb 6, 2019
7127e27
Benchmark results file names include Ruby description
sbellware Feb 6, 2019
8603d8b
Ruby description is noted in all benchmark results files
sbellware Feb 6, 2019
968f32d
TruffleRuby benchmarks with GC on
sbellware Feb 6, 2019
cfa5308
Benchmark cycles are increased from 25,000 to 100,000
sbellware Feb 21, 2019
bed8f56
Put benchmark results post category advisory lock
sbellware Feb 21, 2019
3a92d26
Benchmark allows from destination stream name to be specified by envi…
sbellware Feb 21, 2019
5e82972
Benchmark results for concurrent writers to the same category
sbellware Feb 21, 2019
f0aca7b
Tests are corrected for standardization of settings keys to string data
sbellware Jul 12, 2019
b1ca0e1
New TruffleRuby measurements
sbellware Sep 13, 2019
4d091e3
Merge branch 'benchmarks'
sbellware Sep 14, 2019
e9612e7
Iterator tests for both stream and category
sbellware Sep 24, 2019
87c4ada
Notes on implementation
sbellware Sep 28, 2019
33fc7cf
Stream specialization is constructed if stream name is not a category
sbellware Sep 28, 2019
9e9d71c
Category specialization is constructed if stream name is a category
sbellware Sep 28, 2019
6c5da5a
Specialized retrieval is tested
sbellware Sep 29, 2019
7f61307
Obsolete get tests are removed
sbellware Sep 29, 2019
7b73e51
Stream name is a constructor argument
sbellware Sep 29, 2019
5f2a4c5
Obsolete code is removed
sbellware Sep 29, 2019
cf8f268
Stream name is no longer an actuation parameter, and position is a po…
sbellware Sep 29, 2019
2dceebf
Stream name is passed to constructor from configuration
sbellware Sep 29, 2019
59e0645
Tests are compatible with changes to Get interface
sbellware Sep 29, 2019
0092936
Get is configured with stream name
sbellware Sep 29, 2019
a1db2fe
Iterator no longer accepts stream name as get no longer receives it a…
sbellware Sep 29, 2019
60c2204
Reminder on specialization
sbellware Sep 30, 2019
a08fa07
Get last position is a member of Get
sbellware Sep 30, 2019
968a369
Iterator is a concrete class in the generalized message store library
sbellware Sep 30, 2019
9324aaf
Vestigial code is removed
sbellware Sep 30, 2019
058517d
Get is abstract and stream and category specializations are concrete
sbellware Sep 30, 2019
7b781a9
Get is abstract and stream and category specializations are concrete
sbellware Sep 30, 2019
cee6210
GetLast is in the stream namespace
sbellware Sep 30, 2019
03580bb
Less significant code is moved to a less emphatic place in the file
sbellware Sep 30, 2019
f6c2467
Merge branch 'specialized-get'
sbellware Oct 2, 2019
e1e4372
Package version is increased from 1.0.0.1 to 1.1.0.0
sbellware Oct 2, 2019
8de303a
Test files are compatible with TestBench 2.0
ntl Oct 14, 2019
622df21
Automated test runner supplies exclude file pattern directly into CLI
ntl Oct 17, 2019
4819be1
Parenthesis are added to assert_raises and refute_raises
ntl Oct 17, 2019
7aaa3ac
Sketch is ignored
sbellware Oct 26, 2019
7719665
Get used in iterator test is configured with stream name or category …
sbellware Oct 26, 2019
5ec29de
Separate condition tests for both category and stream
sbellware Oct 27, 2019
8c55fe7
Category get with condition test is suspended
sbellware Oct 27, 2019
7fce05d
Superfluous, vestigial parameters parameter is removed from SQL text …
sbellware Oct 27, 2019
9e4cf02
Condition test is reactivated
sbellware Oct 27, 2019
734800b
Module name is clarified
sbellware Oct 27, 2019
7d873f2
Correlation parameter is received by Get
sbellware Oct 27, 2019
90c082a
Test runner explicitly specifies the tests directory
sbellware Oct 27, 2019
6083078
Put control accepts message_data as well as message for backward comp…
sbellware Oct 27, 2019
a832648
Correlation category get is tested
sbellware Oct 27, 2019
06dbd5a
Test language is clarified
sbellware Oct 27, 2019
42aa940
Correlation stream get is tested
sbellware Oct 27, 2019
916a7d8
Correlation stream get test is corrected
sbellware Oct 27, 2019
931f7de
Specialized starting position tests for both category and stream
sbellware Oct 27, 2019
86d08d8
Specialized no message tests for both category and stream
sbellware Oct 27, 2019
1449f51
Parameter order is corrected
sbellware Oct 30, 2019
1af0762
StreamName module is vestigial. It is removed.
sbellware Nov 1, 2019
7657d9d
Package version is increased from 1.1.0.0 to 1.2.0.0
sbellware Nov 1, 2019
989eab4
Get benchmark is corrected for new Get interface
sbellware Nov 6, 2019
032ba66
Benchmarks
sbellware Nov 6, 2019
2cf8fbf
Test context name is corrected
sbellware Nov 9, 2019
81112dc
Correlation error raised by the database is caught and converted to a…
sbellware Nov 9, 2019
249952e
Merge branch 'v2--correlation-error' into v2
sbellware Nov 9, 2019
e8eb229
Get::Last tests are in the stream namespace
sbellware Nov 9, 2019
90f3d9e
Forcing merge
sbellware Nov 9, 2019
d513c94
Position defaults for category and stream are provided by their indiv…
sbellware Nov 9, 2019
71b4732
SQL command and parameters are specialized per strategy
sbellware Nov 17, 2019
665f7d6
Get implementations are specialized for variant parameters
sbellware Nov 17, 2019
2258512
Get implementation logging is specialized
sbellware Nov 18, 2019
068d2da
Batch retrieval tests are clarified
sbellware Nov 19, 2019
c64fb19
Consumer group test
sbellware Nov 19, 2019
3abcc5c
Use of keyword args is harmonized
sbellware Nov 19, 2019
85d1047
Consumer group test is more thorough
sbellware Nov 19, 2019
d12db43
Consumer group error
sbellware Nov 19, 2019
d684673
Merge branch 'v2--consumer-groups' into v2
sbellware Nov 20, 2019
93c1b23
Argument assurance for stream get removes superfluous arguments
sbellware Nov 20, 2019
4d22edb
StreamName module is vestigial. It is removed.
sbellware Nov 1, 2019
7a3c7c2
Package version is increased from 1.1.0.0 to 1.2.0.0
sbellware Nov 1, 2019
47b7e1f
Get with condition requires activation
sbellware Nov 23, 2019
b95a221
The get_last_message server function is renamed to get_last_stream_me…
sbellware Nov 26, 2019
d07bc55
Position and stream name parameter order is reversed
sbellware Nov 27, 2019
78de279
Get category's internal state is category rather than stream_name
sbellware Nov 27, 2019
71d6c18
Concrete category and stream implementations
sbellware Nov 28, 2019
e56f62e
Specializations are tested
sbellware Nov 28, 2019
f8f990c
Generalized and specialized category retrieval tests are separated
sbellware Nov 30, 2019
95ebfe0
Context namespaces reflect file system organization
sbellware Dec 1, 2019
438a8a7
Merge branch 'v2--specialization-tests' into v2
sbellware Dec 1, 2019
0230550
Error handling is specialized
sbellware Dec 1, 2019
26929b9
Category control is control from base library
sbellware Dec 1, 2019
d15893e
Get specializations assure the input stream name
sbellware Dec 1, 2019
e7fa88b
Obsolete module is removed
sbellware Dec 1, 2019
10c6018
Correlation is no longer supported for stream retrieval
sbellware Dec 2, 2019
f2054a5
Merge branch 'v2--no-stream-correlation' into v2
sbellware Dec 2, 2019
714d271
Stream correlation tests are removed
sbellware Dec 2, 2019
664271a
Consumer group and correlation is moved to generalized namespace
sbellware Dec 3, 2019
e177038
Category retrieval errors
sbellware Dec 3, 2019
db1c364
Category retrieval errors
sbellware Dec 3, 2019
193f97c
Getting last message raises error when the stream name is a category
sbellware Dec 5, 2019
0193331
Merge branch 'v2--get-last-error' into v2
sbellware Dec 5, 2019
a199153
Category retrieval errors
sbellware Dec 3, 2019
94d8e23
Getting last message raises error when the stream name is a category
sbellware Dec 5, 2019
43f1175
Merge branch 'trial-merge' into v2
sbellware Dec 5, 2019
7c96661
Vestigial code is removed
sbellware Dec 5, 2019
bc4f0dd
Duplicated implementation is replaced with use of generalizations
sbellware Dec 6, 2019
62a3a4e
Merge branch 'v2--remove-duplication-in-get-implementations' into v2
sbellware Dec 6, 2019
ca60deb
Dependency on evt-message_store-postgres-database is replaced with me…
sbellware Dec 7, 2019
c6cdb14
Category is a legitimate input to last message retrieval
sbellware Dec 8, 2019
cfa24a8
Test name is clarified
sbellware Dec 9, 2019
4b9040d
Merge branch 'v2'
sbellware Dec 9, 2019
60e195b
Package version is increased from 1.2.0.0 to 2.3.0.0
sbellware Dec 10, 2019
26dc3e9
Obsolete session configuration implementation is removed
sbellware Dec 11, 2019
779620e
Merge branch 'session-configuration'
sbellware Dec 11, 2019
2494949
Package version is increased from 2.3.0.0 to 2.4.0.0
sbellware Dec 11, 2019
6fa7f25
Vestigial logging of correlation in the stream get is removed
sbellware Dec 19, 2019
a68c219
Package version is increased from 2.4.0.0 to 2.4.0.1
sbellware Dec 19, 2019
6fe46c2
Change log is updated as of v2.4.0.1
sbellware Dec 19, 2019
ae07415
Get benchmark is brought up to date with implementation
sbellware Dec 19, 2019
45291e4
Put benchmark prints header
sbellware Dec 19, 2019
32bd981
Get benchmark uses dummy stream name
sbellware Dec 19, 2019
d1aeda0
Separate benchmark for get category
sbellware Dec 19, 2019
9c9ea39
Category benchmark is operational
sbellware Dec 19, 2019
f7ddebc
Category is pre-computed
sbellware Dec 19, 2019
659ec9f
Get benchmark scripts are consistent with each other
sbellware Dec 19, 2019
d4b384a
Verbose output for get stream benchmark
sbellware Dec 19, 2019
ab0a1a6
Benchmark controls receive stream_name and category
sbellware Dec 19, 2019
ba34a68
Merge branch 'benchmarks--controls' into benchmarks
sbellware Dec 19, 2019
421715d
Batch sizes are limited to 1 in get benchmarks
sbellware Dec 19, 2019
6b2ae04
Merge branch 'benchmarks'
sbellware Dec 19, 2019
0853ecc
Benchmarks are consistent
sbellware Dec 19, 2019
4578600
Benchmark results
sbellware Dec 19, 2019
c24c6c0
Benchmarks have consistent output
sbellware Dec 19, 2019
a41a792
Settings default file path is defined by the defaults module
sbellware Feb 2, 2020
cc06fbe
Package version is increased from 2.4.0.1 to 2.4.0.2
sbellware Feb 2, 2020
5e505a3
CLI actuator is corrected
ntl Mar 8, 2020
860ed1a
Identifier dependency type is corrected
sbellware Jul 21, 2020
265fb79
Package version is increased from 2.4.0.2 to 2.4.0.3
sbellware Jul 21, 2020
38ab38e
Identifier dependency is corrected
sbellware Jul 21, 2020
d763a40
Package version is increased from 2.4.0.3 to 2.4.0.4
sbellware Jul 21, 2020
9c10889
Identifier dependency is corrected
sbellware Jul 21, 2020
f48b89b
Package version is increased from 2.4.0.4 to 2.4.0.5
sbellware Jul 21, 2020
58a17aa
Iterator tests suite runner is removed
ntl Jul 23, 2020
c6c288b
Benchmark results
sbellware Nov 20, 2020
31a970e
Session escapes data
sbellware Dec 14, 2020
731cd2d
Package version is increased from 2.4.0.5 to 2.4.1.0
sbellware Dec 14, 2020
4b47615
Keepalive and tcp timeout settings are supported
aaronjensen Feb 25, 2021
15891f2
Merge pull request #18 from aaronjensen/keepalive
sbellware Mar 5, 2021
6683df5
Package version is increased from 2.4.1.0 to 2.4.2.0
sbellware Mar 5, 2021
115108a
Connection test sends a semicolon rather than a complete statement
sbellware Feb 14, 2022
78187ab
Connection records time of last use
sbellware Feb 14, 2022
bacff97
Connection reports elapsed milliseconds since last execution
sbellware Feb 14, 2022
81262b2
Merge branch 'connection-time'
sbellware Feb 14, 2022
74127ae
Package version is increased from 2.4.2.0 to 2.4.3.0
sbellware Feb 14, 2022
be88edf
Session connection executed time is corrected
aaronjensen Feb 14, 2022
ef28d77
Session closing is tested
ntl Feb 17, 2022
e97e2f1
Vestigial variable is removed
aaronjensen Apr 13, 2022
9bbe526
Merge pull request #24 from aaronjensen/vestigial-variable
sbellware Jul 12, 2022
7bd2b2a
Merge pull request #20 from aaronjensen/session-test-correction
sbellware Jul 12, 2022
34e7428
Get stream last supports an optional type parameter
aaronjensen Feb 14, 2022
c0f854b
Merge pull request #23 from eventide-project/session-close-test
sbellware Jul 12, 2022
9e4d6b5
Merge pull request #21 from aaronjensen/get-stream-last-type
sbellware Jul 12, 2022
b4ac6b1
Session close is corrected
aaronjensen Jul 12, 2022
4c94f76
Get stream last is backwards compatible with versions of message-db t…
aaronjensen Jul 12, 2022
512a8c9
Merge pull request #25 from aaronjensen/corrections
sbellware Jul 12, 2022
b69c780
Package version is increased from 2.4.3.0 to 2.4.4.0
sbellware Oct 13, 2022
be98c91
Get::Stream::Last Type parameter is positional, rather than named
sbellware Oct 14, 2022
c05e88c
Package version is increased from 2.4.4.0 to 2.5.0.0
sbellware Oct 14, 2022
766fe39
Merge 'message-store-postgres'
aaronjensen Jan 21, 2023
9b102d1
message-store and message-store-postgres are combined
aaronjensen Jan 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Gemfile.lock
*.log
*.gem
gems

lib/message_store/event_store
lib/message_store/event_store.rb
lib/message_store/postgres
lib/message_store/postgres.rb
*scratch*
*notes*
loader.rb
/test/package/installed
/test/benchmark/tmp/**/*
_sketch.rb
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changes

## 2.4.0.1

Thu Dec 19 2019

- Vestigial logging of correlation in Get::Stream is removed (It no longer has correlation handling as of v2)
2 changes: 1 addition & 1 deletion MIT-License.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 Scott Bellware
Copyright (c) 2015-present Scott Bellware

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# message_store
# message_store-postgres

Common primitives for platform-specific message store implementations.
Message store implementation for PostgreSQL.

## Documentation

See the [Eventide documentation site](http://docs.eventide-project.org) for more information, examples, and user guides.

## License

The `event_stream-postgres` library is released under the [MIT License](https://github.com/eventide-project/event-stream-postgres/blob/master/MIT-License.txt).
The `message_store-postgres` library is released under the [MIT License](https://github.com/eventide-project/message-store-postgres/blob/master/MIT-License.txt).
20 changes: 16 additions & 4 deletions lib/message_store.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'pp'
require 'json'
require 'pg'

require 'casing'
require 'identifier/uuid'
Expand All @@ -9,9 +8,12 @@
require 'virtual'
require 'async_invocation'

require 'log'
require 'settings'

require 'message_store/expected_version'
require 'message_store/no_stream'
require 'message_store/id'
require 'message_store/no_stream'
require 'message_store/stream_name'

require 'message_store/message_data'
Expand All @@ -21,10 +23,20 @@

require 'message_store/log'

require 'message_store/settings'
require 'message_store/session'

require 'message_store/put'
require 'message_store/write'

require 'message_store/get'
require 'message_store/get/substitute'
require 'message_store/get/condition'
require 'message_store/get/stream'
require 'message_store/get/stream/last'
require 'message_store/get/stream/last/substitute'
require 'message_store/get/category'
require 'message_store/get/category/correlation'
require 'message_store/get/category/consumer_group'
require 'message_store/read/iterator'
require 'message_store/read'
require 'message_store/write'
8 changes: 4 additions & 4 deletions lib/message_store/controls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
require 'message_store/controls/category'
require 'message_store/controls/stream_name'
require 'message_store/controls/read'
require 'message_store/controls/position'
require 'message_store/controls/message_data'
require 'message_store/controls/message_data/hash'
require 'message_store/controls/message_data/metadata'
require 'message_store/controls/message_data/write'
require 'message_store/controls/message_data/hash'
require 'message_store/controls/message_data/read'
require 'message_store/controls/write'
require 'message_store/controls/message_data/write'
require 'message_store/controls/put'
require 'message_store/controls/get'
require 'message_store/controls/get_last'
33 changes: 0 additions & 33 deletions lib/message_store/controls/get_last.rb

This file was deleted.

20 changes: 20 additions & 0 deletions lib/message_store/controls/message_data/write.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,26 @@ def self.data
def self.metadata
MessageData::Metadata.data
end

module List
Entry = Struct.new(:stream_name, :category, :message_data)

def self.get(instances: nil, stream_name: nil, category: nil)
instances ||= 1

list = []
instances.times do
instance_stream_name = stream_name || StreamName.example(category: category)
instance_category = MessageStore::StreamName.get_category(instance_stream_name)

write_message = Controls::MessageData::Write.example

list << Entry.new(instance_stream_name, instance_category, write_message)
end

list
end
end
end
end
end
Expand Down
13 changes: 13 additions & 0 deletions lib/message_store/controls/position.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module MessageStore
module Controls
module Position
def self.example
1
end

def self.max
(2 ** 63) - 1
end
end
end
end
26 changes: 26 additions & 0 deletions lib/message_store/controls/put.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module MessageStore
module Controls
module Put
def self.call(instances: nil, stream_name: nil, message_data: nil, message: nil, category: nil, type: nil)
instances ||= 1
stream_name ||= StreamName.example(category: category)
message_data ||= message

message_specified = !message_data.nil?

message_data ||= MessageData::Write.example(type: type)

position = nil
instances.times do
position = MessageStore::Put.(message_data, stream_name)

unless message_specified
message_data.id = MessageData::Write.id
end
end

[stream_name, position]
end
end
end
end
11 changes: 1 addition & 10 deletions lib/message_store/controls/read.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,10 @@ module Read
def self.example(stream_name: nil)
stream_name ||= StreamName.example

read = Example.build(stream_name)

get = Get.example(stream_name: stream_name)
read.iterator.get = get
read = MessageStore::Read.build(stream_name)

read
end

class Example
include MessageStore::Read

def configure(*); end
end
end
end
end
23 changes: 0 additions & 23 deletions lib/message_store/controls/write.rb

This file was deleted.

Loading