Skip to content

Commit

Permalink
service bus spike
Browse files Browse the repository at this point in the history
  • Loading branch information
smiggleworth committed Jun 11, 2017
1 parent f97a5ee commit 119881f
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="4.19.2" />
<PackageReference Include="GenFu" Version="1.2.1" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="0.0.6-preview" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;
using Quidjibo.Configurations;

namespace Quidjibo.Azure.ServiceBus.Configurations
{
public class ServiceBusQuidjiboConfiguration: IQuidjiboConfiguration {
public List<string> Queues { get; }
public bool SingleLoop { get; }
public int PollingInterval { get; }
public int MaxAttempts { get; }
public int LockInterval { get; }
public int Throttle { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Quidjibo.Factories;
using Quidjibo.Providers;

namespace Quidjibo.Azure.ServiceBus.Factories
{
public class ServiceBusWorkProviderFactory : IWorkProviderFactory
{
public Task<IWorkProvider> CreateAsync(string queue, CancellationToken cancellationToken = new CancellationToken())
{
throw new NotImplementedException();
}
}
}
37 changes: 37 additions & 0 deletions src/Quidjibo.Azure.ServiceBus/Providers/ServiceBusWorkProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Quidjibo.Models;
using Quidjibo.Providers;

namespace Quidjibo.Azure.ServiceBus.Providers
{
public class ServiceBusWorkProvider : IWorkProvider
{
public Task SendAsync(WorkItem item, int delay, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

public Task<List<WorkItem>> ReceiveAsync(string worker, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

public Task<DateTime> RenewAsync(WorkItem workItem, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

public Task CompleteAsync(WorkItem workItem, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

public Task FaultAsync(WorkItem workItem, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
<PackageTags>async, tasks, workers, cron</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="0.0.6-preview" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Quidjibo\Quidjibo.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
<ProjectReference Include="..\Quidjibo\Quidjibo.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

using Quidjibo.DataProtection.Protectors;
using Quidjibo.DataProtection.Protectors;
using Quidjibo.Serializers;

namespace Quidjibo.DataProtection.Extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
<ProjectReference Include="..\Quidjibo.DependencyInjection\Quidjibo.DependencyInjection.csproj" />
<ProjectReference Include="..\Quidjibo\Quidjibo.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<ProjectReference Include="..\Quidjibo.StructureMap\Quidjibo.StructureMap.csproj" />
<ProjectReference Include="..\Quidjibo\Quidjibo.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions src/Quidjibo/Models/Cron.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace Quidjibo.Models
{
public class Cron
Expand All @@ -9,9 +11,9 @@ public Cron(string expression)
Expression = expression;
}

public static Cron EveryXMinute(int minute = 0)
public static Cron MinuteIntervals(int minute = 1)
{
return new Cron($"*/{minute} * * * *");
return new Cron($"*/{Math.Max(1, minute)} * * * *");
}

public static Cron Daily(int hour = 0, int minute = 0)
Expand Down

0 comments on commit 119881f

Please sign in to comment.