Commit 8efaf8f4 authored by Haye Böhm's avatar Haye Böhm

RemoteSource/Service: Keep Maybe ConnectionId instead of separate alternative

parent 6c130794
Pipeline #17305 failed with stage
in 1 minute and 21 seconds
......@@ -13,30 +13,30 @@ derive class iTask TestRecord
:: TestRecord = {number :: Int, numbers :: [Int], text :: String, texts :: [String]}
testShare = sharedStore "sharedStoreNamebla" {number = 37, numbers = [1, 2, 3], text = "Test", texts = ["een", "twee", "drie", "vier"]}
remoteTestShare = remoteShare testShare {domain = "TEST", port = 9999}
remoteTestShare = remoteShare testShare {domain = "localhost", port = 9999}
leftShare = sharedStore "leftShare" (1, 2, 3)
rightShare = sharedStore "rightShare" (10, 20, 30)
parallelShare = leftShare >*< rightShare
remoteParallelShare = remoteShare parallelShare {domain = "TEST", port = 9999}
remoteParallelShare = remoteShare parallelShare {domain = "localhost", port = 9999}
parallelWithLeftRemote = (remoteShare leftShare {domain = "TEST", port = 9999}) >*< rightShare
parallelWithRightRemote = leftShare >*< (remoteShare rightShare {domain = "TEST", port = 9999})
parallelWithLeftRemote = (remoteShare leftShare {domain = "localhost", port = 9999}) >*< rightShare
parallelWithRightRemote = leftShare >*< (remoteShare rightShare {domain = "localhost", port = 9999})
intShare = sharedStore "intShare" 15
simpleShare = remoteShare intShare {domain="TEST", port=9999}
simpleShare = remoteShare intShare {domain="localhost", port=9999}
projectedRemote = sdsProject (SDSLensRead (\r. Ok (r + 2))) (SDSLensWrite (\_ r. Ok (Just (r - 2)))) (Just \_ ws. Ok (ws + 2)) simpleShare
projectedLocal = sdsProject (SDSLensRead (\r. Ok (r + 2))) (SDSLensWrite (\_ r. Ok (Just (r - 2)))) (Just \_ ws. Ok (ws + 2)) intShare
selectShare = sdsSelect "testSelect" param (SDSNotifyConst (\_ _ _ _-> False)) (SDSNotifyConst (\_ _ _ _-> False))
(remoteShare leftShare {domain="TEST", port=9999}) rightShare
(remoteShare leftShare {domain="localhost", port=9999}) rightShare
where
param i
| i == 0 = Left ()
= Right ()
doubleRemote = remoteShare simpleShare {domain="TEST", port=9998}
doubleRemote = remoteShare simpleShare {domain="localhost", port=9998}
Start world = doTasks tests world
where
......
This diff is collapsed.
This diff is collapsed.
......@@ -252,24 +252,12 @@ required type w. The reducer has the job to turn this ws into w.
:: SDSCacheWrite = WriteNow | WriteDelayed | NoWrite
:: SDSRemoteSource p r w =
/**
* A SDSRemoteSource is a share tree living on another system. Evaluating it will cause an
* asynchronous message to be sent to the other server to retrieve the value for the
* specified operation.
*/
E. sds: SDSRemoteSource (sds p r w) SDSShareOptions & RWShared sds
/**
* This alternative is used when a remote sds is waiting on a asynchronous operation to be
* completed.The connection id can be used to query the environment for a result.
*
* An extra copy to the share options is used so that we may use it to identify to which
* server a message has been sent.
*
* We keep the original SDSRemoteSource so that we can later rewrite this node to it. This is
* used when modifying a remote share requires reading, then writing to it.
*/
| SDSRemoteSourceQueued ConnectionId (SDSRemoteSource p r w) SDSShareOptions
/**
* A SDSRemoteSource is a share tree living on another system. Evaluating it will cause an
* asynchronous message to be sent to the other server to retrieve the value for the
* specified operation.
*/
:: SDSRemoteSource p r w = E. sds: SDSRemoteSource (sds p r w) (Maybe ConnectionId) SDSShareOptions & RWShared sds
:: WebServiceShareOptions p r w = HTTPShareOptions (HTTPHandlers p r w)
| TCPShareOptions (TCPHandlers p r w)
......@@ -289,16 +277,10 @@ required type w. The reducer has the job to turn this ws into w.
, fromTextResponse :: String p Bool -> MaybeErrorString (Maybe r, Maybe String)
, writeMessageHandlers :: Maybe (p w -> String, p String -> MaybeErrorString (Maybe (SDSNotifyPred p)))
}
:: SDSRemoteService p r w =
/**
* A SDSRemoteServive is a share which allows you to connect to the outside world.
* For now it just allows you to send HTTP messages and receive responses asynchronously.
*/
SDSRemoteService (WebServiceShareOptions p r w)
/**
* Used when waiting on a asynchronous service call to be completed.
*/
| SDSRemoteServiceQueued ConnectionId (SDSRemoteService p r w) (WebServiceShareOptions p r w)
/**
* A SDSRemoteServive is a share which allows you to connect to the outside world.
* For now it just allows you to send HTTP messages and receive responses asynchronously.
*/
:: SDSRemoteService p r w = SDSRemoteService (Maybe ConnectionId) (WebServiceShareOptions p r w)
:: SDSDebug p r w = E. sds: SDSDebug String (sds p r w) & RWShared sds
......@@ -108,10 +108,10 @@ where
= copy (i + 1) {n & [i] = '_'}
remoteShare :: (sds p r w) SDSShareOptions -> SDSRemoteSource p r w | RWShared sds
remoteShare sds opts = SDSRemoteSource sds opts
remoteShare sds opts = SDSRemoteSource sds Nothing opts
remoteService :: (WebServiceShareOptions p r w) -> SDSRemoteService p r w
remoteService opts = SDSRemoteService opts
remoteService opts = SDSRemoteService Nothing opts
debugShare :: String (sds p r w) -> SDSDebug p r w | RWShared sds
debugShare name sds = SDSDebug name sds
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment