Skip to content

Commit

Permalink
Add intepretation of Anoma that connects to an existing client
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed Nov 19, 2024
1 parent eab02a7 commit 11a4333
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Anoma/Effect/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Anoma.Effect.Base
anomaProcessHandle,
anomaPath,
runAnomaEphemeral,
runAnomaWithClient,
launchAnoma,
module Anoma.Rpc.Base,
module Juvix.Compiler.Nockma.Translation.FromTree,
Expand Down Expand Up @@ -117,6 +118,12 @@ runAnomaEphemeral anomapath body = runReader anomapath . runProcess $ do
(`interpret` inject body) $ \case
AnomaRpc method i -> anomaRpc' method i

runAnomaWithClient :: forall r a. (Members '[Logger, EmbedIO, Error SimpleError] r) => AnomaGrpcClientInfo -> Sem (Anoma ': r) a -> Sem r a
runAnomaWithClient grpcInfo body = runProcess $ do
runReader grpcInfo $ do
(`interpret` inject body) $ \case
AnomaRpc method i -> anomaRpc' method i

launchAnoma :: (Members '[Logger, EmbedIO, Error SimpleError] r) => AnomaPath -> Sem r ProcessHandle
launchAnoma anomapath = runReader anomapath . runProcess $ do
cproc <- anomaCreateProcess
Expand Down

0 comments on commit 11a4333

Please sign in to comment.