Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open System
- open Hopac
- open Hopac.Infixes
- let rec serverUntil evt j =
- evt <|> (memo j ^=> fun _ -> serverUntil evt j)
- let printDelay msg =
- timeOutMillis 200 >>- fun _ -> printfn "%s" msg
- //^=> fun _ -> printfn "sdf"; Job.result 10
- [<EntryPoint>]
- let main argv =
- //let j = memo <| timeOutMillis 1000
- let j =
- timeOutMillis 500
- >>- (fun _ -> printfn "timeout"; 10)
- >>= (fun x -> timeOutMillis 500 >>-. x)
- |> memo
- serverUntil j (printDelay "hello") |> Job.Ignore |> start |> ignore
- let r = Promise.read j |> run
- printfn "val: %A" r
- let a = Console.ReadLine ()
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement