This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
type AuditedProcess<'T> = unit -> Option<'T> | |
let runAuditedProcess (auditedProcess : AuditedProcess<_>) = | |
auditedProcess () | |
let doAuditedProcess (auditedProcess : AuditedProcess<_>) = | |
runAuditedProcess auditedProcess |> ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type TestErrorBuilder () = | |
member this.Bind (expr, func) = | |
try | |
match expr () with | |
| None -> fun () -> None | |
| Some r -> | |
func r | |
with | |
| _ as e -> | |
printfn "%A" e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let agent = | |
AutoCancelAgent.Start(fun inbox -> async { | |
while true do | |
audit { | |
use! client = audit { return getClient () } | |
Log "Checking email..." | |
do! audit { return CollectMessages client } | |
expunge client | |
} |> doAuditedProcess | |
do! Async.Sleep(match pollInterval with Interval s -> s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let interval i = | |
let x = float i | |
let maxWait = 60. * 10. | |
let raisePower x = pown (x /10.) 4 | |
(maxWait * (raisePower x)) / (raisePower x + 1.) | |
|> (*) 1000. |> int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(** | |
## References | |
As they aren't part of a project, fsx files need | |
to reference all of their dependencies within the | |
file. | |
You'll always want to reference FakeLib. VersionUpdater | |
is an inhouse tool we use for handling feature branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(** | |
## References | |
As they aren't part of a project, fsx files need | |
to reference all of their dependencies within the | |
file. | |
You'll always want to reference FakeLib. VersionUpdater | |
is an inhouse tool we use for handling feature branch |
OlderNewer