Skip to content

Commit

Permalink
Move Ingest to Sync Template
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Apr 14, 2019
1 parent 8302f0e commit 269c2ab
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 74 deletions.
36 changes: 0 additions & 36 deletions equinox-ingest/Ingest/Infrastructure.fs

This file was deleted.

26 changes: 0 additions & 26 deletions equinox-ingest/Ingest/Ingest.fsproj

This file was deleted.

17 changes: 17 additions & 0 deletions equinox-sync/Ingest/Ingest.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<WarningLevel>5</WarningLevel>
</PropertyGroup>

<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Sync\Sync.fsproj" />
</ItemGroup>

</Project>
File renamed without changes.
11 changes: 0 additions & 11 deletions equinox-sync/Sync/CosmosIngester.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,6 @@ type CatStats() =
member __.Clear() = cats.Clear()
member __.StatsDescending = cats |> Seq.map (|KeyValue|) |> Seq.sortByDescending snd

module Queue =
let tryDequeue (x : System.Collections.Generic.Queue<'T>) =
#if NET461
if x.Count = 0 then None
else x.Dequeue() |> Some
#else
match x.TryDequeue() with
| false, _ -> None
| true, res -> Some res
#endif

type ResultKind = TimedOut | RateLimited | Malformed | Ok

type StreamStates() =
Expand Down
13 changes: 12 additions & 1 deletion equinox-sync/Sync/Infrastructure.fs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[<AutoOpen>]
module private Infrastructure
module SyncTemplate.Infrastructure

open Equinox.Store // AwaitTaskCorrect
open System
Expand All @@ -19,6 +19,17 @@ type Async with
and d : IDisposable = Console.CancelKeyPress.Subscribe callback
in ())

module Queue =
let tryDequeue (x : System.Collections.Generic.Queue<'T>) =
#if NET461
if x.Count = 0 then None
else x.Dequeue() |> Some
#else
match x.TryDequeue() with
| false, _ -> None
| true, res -> Some res
#endif

type SemaphoreSlim with
/// F# friendly semaphore await function
member semaphore.Await(?timeout : System.TimeSpan) = async {
Expand Down
6 changes: 6 additions & 0 deletions equinox-sync/equinox-sync.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Sync.Tests", "Sync.Tests\Sync.Tests.fsproj", "{1A5997B1-48F3-43FC-B5AD-661EF4B8B15D}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Ingest", "Ingest\Ingest.fsproj", "{BB7079A7-53E8-4843-8981-78DD025F8C91}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,6 +27,10 @@ Global
{1A5997B1-48F3-43FC-B5AD-661EF4B8B15D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1A5997B1-48F3-43FC-B5AD-661EF4B8B15D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1A5997B1-48F3-43FC-B5AD-661EF4B8B15D}.Release|Any CPU.Build.0 = Release|Any CPU
{BB7079A7-53E8-4843-8981-78DD025F8C91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BB7079A7-53E8-4843-8981-78DD025F8C91}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB7079A7-53E8-4843-8981-78DD025F8C91}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB7079A7-53E8-4843-8981-78DD025F8C91}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 269c2ab

Please sign in to comment.