member this.sendRecieve (message:string) :Async<string> = async {
let initialTime = System.TimeSpan.FromMilliseconds(10000.)
let checkTime = 300
cq.Clear |> ignore
ps.StandardInput.WriteLine(message)
// 標準出力の初期出力はなんとなく遅いので
// 多めに待ってあげる
let sw = new System.Diagnostics.Stopwatch();
sw.Start();
while cq.IsEmpty do
if sw.Elapsed > initialTime then
raise (System.ArgumentException("===== foo =====") )
()
// cq.Countが300ms以内に変化がなければ
// 全て出力されたとみなして値を返す
let rec foo () =
let mutable currentCount = cq.Count
Async.Sleep checkTime |> ignore
if currentCount = cq.Count then
snd ( cq.TryDequeue() ) |> fun x -> x.Data
else
foo ()
return ( foo () )
}
InterLocked
使いたかったのですが、実装できませんでした・・・
Thread.Sleep
???
fsc
と lsp
のおかげです!
ギットハブ
アカウント2つで
アカンと(博多弁)
ISourceText
型とはなんなのでしょうか?
string
型でコードを書いていた部分がISourceText
型に変更になったらしく書き換えないといけないのですが、うまくいってません。。。