Swirrl / drafter

A clojure service and a client to it for exposing data management operations to PMD
Other
0 stars 0 forks source link

Add write-loop pause control #631

Closed scottlowe closed 2 years ago

scottlowe commented 2 years ago

Addresses issue https://github.com/Swirrl/drafter/issues/538, and relates to issue https://github.com/Swirrl/drafter/issues/548. To play with this:

Start drafter ...

(dev)
(set-prep! (prep-system-profile :basic))
(reset)

Starting drafter will automatically start a socket on port 5555 which can be used to pause / contunue Drafter's write-loop.

Then use the simple package/install/drafter-toggle-writing.sh script pause / continue toggle function over the socket:

Screenshot 2022-08-23 at 10 31 21 AM

You can view the logged effect with tail -f drafter-test.log.

NOTE: there is a duplicate logging (timestamps are identical too) - it's seems to be an artifact of running the socket REPL:

Screenshot 2022-08-23 at 11 46 15 AM
scottlowe commented 2 years ago

Whilst the tests seem a bit contrived - it's the best I could do.

Also: I was very surprised to discover that the existing write-scheduler tests don't actually start the write-loop in the write-scheduler! For a long time I couldn't understand why none of my tests were working or returning.

Fair enough - I think some of the higher level API calls that write to the DB effectively excercise this stuff, but the "coverage" that the drafter.write-scheduler-test test namespace previously appeared to offer feels misleading to me.

Regardless, my additional tests do now actually start the write-scheduler.

scottlowe commented 2 years ago

Update: This pause control has been currently shelved following clarification in the issue here: https://github.com/Swirrl/drafter/issues/548#issuecomment-1227425832

I will rework this.

scottlowe commented 2 years ago

Following further discussion, this PR has been superceded by this new PR https://github.com/Swirrl/drafter/pull/634.