New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PLT-5847 marlowe-contract service #578
Conversation
marlowe-runtime-cli/app/Language/Marlowe/Runtime/CLI/Command/Load.hs
Outdated
Show resolved
Hide resolved
b41ffa3
to
1402a68
Compare
d9fbdc0
to
15c446e
Compare
6e12ec8
to
e3b2f10
Compare
15c446e
to
0b1da8a
Compare
e3b2f10
to
8b1c61b
Compare
d623136
to
1cb6ab3
Compare
a4fbb42
to
3278c19
Compare
countNodes :: Int -> FilePath -> CountM Int | ||
countNodes count path = withContract path $ countNodes' count | ||
|
||
countNodes' :: Int -> LoadContract -> CountM Int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the multiplate in Language.Marlowe.Core.V1.Plate
could be used to do this counting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, the concept of a Node
is somewhat abstract though, and isn't directly captured by anything in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I see that LoadContract
is not Contract
, which is what the plate acts on.
import System.IO.LockFile (withLockFile) | ||
import UnliftIO | ||
import UnliftIO.Directory | ||
( XdgDirectory(XdgData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the XDG stuff portable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is
bufferSizeParser = option readOption $ mconcat | ||
[ long "buffer-size" | ||
, short 'b' | ||
, value 4098 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems too high. Are exceptions caught in a way the forces a flush before exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1024 could be a better default. The staging area is wrapped in a bracket that discards the entire temp staging directory on exception. So there should be no resource leak (though nothing will protect from a SIGKILL or a loss of power of course).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I'll do an on-chain test when marlowe-runtime-cli create
supports this.
0c1480d
to
2b7f9a1
Compare
Co-authored-by: Brian W Bush <brian.bush@iohk.io>
2b7f9a1
to
a2d7ff7
Compare
marlowe-contract
service to runtime topologyMarloweLoad
protocol toMarloweRuntime
protocolload
command tomarlowe-runtime-cli
load
command.Pre-submit checklist: