Skip to content

Commit c6e06ef

Browse files
committed
Merge pull request #8 from fsprojects/fix-5
remove Agent.fs
2 parents ec9904d + fec91ca commit c6e06ef

5 files changed

Lines changed: 4 additions & 13 deletions

File tree

src/FSharp.Control.AsyncSeq/Agent.fs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ module AsyncSeq =
411411
/// sequence specified as the input. When accessing the resulting sequence
412412
/// multiple times, the input will still be evaluated only once
413413
let rec cache (input : AsyncSeq<'T>) =
414-
let agent = Agent<AsyncReplyChannel<_>>.Start(fun agent -> async {
414+
let agent = MailboxProcessor<AsyncReplyChannel<_>>.Start(fun agent -> async {
415415
let! (repl:AsyncReplyChannel<AsyncSeqInner<'T>>) = agent.Receive()
416416
let! next = input
417417
let res =

src/FSharp.Control.AsyncSeq/AutoCancelAgent.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ open System.Threading
1313
/// Wrapper for the standard F# agent (MailboxProcessor) that
1414
/// supports stopping of the agent's body using the IDisposable
1515
/// interface (the type automatically creates a cancellation token)
16-
type internal AutoCancelAgent<'T> private (mbox:Agent<'T>, cts:CancellationTokenSource) =
16+
type internal AutoCancelAgent<'T> private (mbox:MailboxProcessor<'T>, cts:CancellationTokenSource) =
1717

1818
/// Start a new disposable agent using the specified body function
1919
/// (the method creates a new cancellation token for the agent)
2020
static member Start(f) =
2121
let cts = new CancellationTokenSource()
22-
new AutoCancelAgent<'T>(Agent<'T>.Start(f, cancellationToken = cts.Token), cts)
22+
new AutoCancelAgent<'T>(MailboxProcessor<'T>.Start(f, cancellationToken = cts.Token), cts)
2323

2424
/// Returns the number of unprocessed messages in the message queue of the agent.
2525
member x.CurrentQueueLength = mbox.CurrentQueueLength

src/FSharp.Control.AsyncSeq/BlockingQueueAgent.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type internal BlockingQueueAgent<'T>(maxLength) =
2323
[<VolatileField>]
2424
let mutable count = 0
2525

26-
let agent = Agent.Start(fun agent ->
26+
let agent = MailboxProcessor.Start(fun agent ->
2727

2828
let queue = new Queue<'T>()
2929

src/FSharp.Control.AsyncSeq/FSharp.Control.AsyncSeq.fsproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
<Import Project="..\..\.paket\paket.targets" />
6060
<ItemGroup>
6161
<Compile Include="Utils.fs" />
62-
<Compile Include="Agent.fs" />
6362
<Compile Include="AutoCancelAgent.fs" />
6463
<Compile Include="BlockingQueueAgent.fs" />
6564
<Compile Include="Observable.fs" />

0 commit comments

Comments
 (0)