Skip to content

Commit

Permalink
Updated Readme and Foundatio
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Mar 27, 2024
1 parent c032deb commit e69fdc6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ When building several big cloud applications we found a lack of great solutions
- Wanted to build against abstract interfaces so that we could easily change implementations.
- Wanted the blocks to be dependency injection friendly.
- Caching: We were initially using an open source Redis cache client but then it turned into a commercial product with high licensing costs. Not only that, but there weren't any in memory implementations so every developer was required to set up and configure Redis.
- Message Bus: We initially looked at [NServiceBus](http://particular.net/nservicebus) (great product) but it had high licensing costs (they have to eat too) but was not OSS friendly. We also looked into [MassTransit](http://masstransit-project.com/) but found Azure support lacking and local set up a pain. We wanted a simple message bus that just worked locally or in the cloud.
- Message Bus: We initially looked at [NServiceBus](http://particular.net/nservicebus) (great product) but it had high licensing costs (they have to eat too) but was not OSS friendly. We also looked into [MassTransit](http://masstransit-project.com/) (another great product) but found Azure support lacking at the time and local set up a pain (for in memory). We wanted a simple message bus that just worked locally or in the cloud.
- Storage: We couldn't find any existing project that was decoupled and supported in memory, file storage or Azure Blob Storage.

To summarize, if you want pain free development and testing while allowing your app to scale, use Foundatio!
Expand All @@ -51,6 +51,7 @@ To summarize, if you want pain free development and testing while allowing your
2. Open the `Foundatio.sln` Visual Studio solution file.

## Using Foundatio

The sections below contain a small subset of what's possible with Foundatio. We recommend taking a peek at the source code for more information. Please let us know if you have any questions or need assistance!

### [Caching](https://github.com/FoundatioFx/Foundatio/tree/master/src/Foundatio/Caching)
Expand Down Expand Up @@ -152,7 +153,7 @@ Allows you to run a long running process (in process or out of process) without

1. **Jobs**: All jobs must derive from the [`IJob` interface](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/IJob.cs). We also have a [`JobBase` base class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/JobBase.cs) you can derive from which provides a JobContext and logging. You can then run jobs by calling `RunAsync()` on the job or by creating a instance of the [`JobRunner` class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/JobRunner.cs) and calling one of the Run methods. The JobRunner can be used to easily run your jobs as Azure Web Jobs.

#### Sample
#### Sample

```csharp
using Foundatio.Jobs;
Expand All @@ -176,7 +177,7 @@ Allows you to run a long running process (in process or out of process) without

2. **Queue Processor Jobs**: A queue processor job works great for working with jobs that will be driven from queued data. Queue Processor jobs must derive from [`QueueJobBase<T>` class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/QueueJobBase.cs). You can then run jobs by calling `RunAsync()` on the job or passing it to the [`JobRunner` class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/JobRunner.cs). The JobRunner can be used to easily run your jobs as Azure Web Jobs.
#### Sample
#### Sample

```csharp
using Foundatio.Jobs;
Expand Down Expand Up @@ -218,7 +219,7 @@ Allows you to run a long running process (in process or out of process) without

3. **Work Item Jobs**: A work item job will run in a job pool among other work item jobs. This type of job works great for things that don't happen often but should be in a job (Example: Deleting an entity that has many children.). It will be triggered when you publish a message on the `message bus`. The job must derive from the [`WorkItemHandlerBase` class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/WorkItemJob/WorkItemHandlerBase.cs). You can then run all shared jobs via [`JobRunner` class](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Jobs/JobRunner.cs). The JobRunner can be used to easily run your jobs as Azure Web Jobs.

#### Sample
#### Sample

```csharp
using System.Threading.Tasks;
Expand Down Expand Up @@ -307,8 +308,8 @@ We provide five implementations that derive from the [`IMetricsClient` interface
2. [RedisMetricsClient](https://github.com/FoundatioFx/Foundatio.Redis/blob/master/src/Foundatio.Redis/Metrics/RedisMetricsClient.cs): An Redis metrics implementation.
3. [StatsDMetricsClient](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio/Metrics/StatsDMetricsClient.cs): An statsd metrics implementation.
4. [MetricsNETClient](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio.MetricsNET/MetricsNETClient.cs): An [Metrics.NET](https://github.com/Recognos/Metrics.NET) implementation.
4. [AppMetricsClient](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio.AppMetrics/AppMetricsClient.cs): An [AppMetrics](https://github.com/AppMetrics/AppMetrics) implementation.
5. [CloudWatchMetricsClient](https://github.com/FoundatioFx/Foundatio.AWS/blob/master/src/Foundatio.AWS/Metrics/CloudWatchMetricsClient.cs): An [AWS CloudWatch](https://aws.amazon.com/cloudwatch/) implementation.
5. [AppMetricsClient](https://github.com/FoundatioFx/Foundatio/blob/master/src/Foundatio.AppMetrics/AppMetricsClient.cs): An [AppMetrics](https://github.com/AppMetrics/AppMetrics) implementation.
6. [CloudWatchMetricsClient](https://github.com/FoundatioFx/Foundatio.AWS/blob/master/src/Foundatio.AWS/Metrics/CloudWatchMetricsClient.cs): An [AWS CloudWatch](https://aws.amazon.com/cloudwatch/) implementation.
We recommend using all of the `IMetricsClient` implementations as singletons.

Expand All @@ -322,6 +323,7 @@ metrics.Timer("t1", 50788);
```

## Sample Application

We have both [slides](https://docs.google.com/presentation/d/1ax4YmfCdao75aEakjdMvapHs4QxvTZOimd3cHTZ9JG0/edit?usp=sharing) and a [sample application](https://github.com/FoundatioFx/Foundatio.Samples) that shows off how to use Foundatio.
## Thanks to all the people who have contributed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Foundatio.Xunit" Version="10.7.0" />
<PackageReference Include="Foundatio.Xunit" Version="10.7.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions samples/Foundatio.SampleJobClient/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -15,14 +15,14 @@ public class Program
{
private static IQueue<PingRequest> _queue;
private static IMessageBus _messageBus;
private static TestLoggerFactory _loggerFactory;
private static TestLogger _loggerFactory;
private static ILogger _logger;
private static bool _isRunning = true;
private static CancellationTokenSource _continuousEnqueueTokenSource = new();

public static void Main(string[] args)
{
_loggerFactory = new TestLoggerFactory();
_loggerFactory = new TestLogger();
_loggerFactory.SetLogLevel<RedisMessageBus>(LogLevel.Trace);
_loggerFactory.MaxLogEntriesToStore = Console.WindowHeight - (OPTIONS_MENU_LINE_COUNT + SEPERATOR_LINE_COUNT) - 1;
_logger = _loggerFactory.CreateLogger<Program>();
Expand Down
2 changes: 1 addition & 1 deletion src/Foundatio.Redis/Foundatio.Redis.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\build\common.props" />
<ItemGroup>
<PackageReference Include="Foundatio" Version="10.7.0" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />
<PackageReference Include="Foundatio" Version="10.7.1" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />
<ProjectReference Include="..\..\..\Foundatio\src\Foundatio\Foundatio.csproj" Condition="'$(ReferenceFoundatioSource)' == 'true'" />

<PackageReference Include="StackExchange.Redis" Version="2.7.33" />
Expand Down
2 changes: 1 addition & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="All" />

<PackageReference Include="Foundatio.TestHarness" Version="10.7.0" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />
<PackageReference Include="Foundatio.TestHarness" Version="10.7.1" Condition="'$(ReferenceFoundatioSource)' == '' OR '$(ReferenceFoundatioSource)' == 'false'" />
<ProjectReference Include="..\..\..\Foundatio\src\Foundatio.TestHarness\Foundatio.TestHarness.csproj" Condition="'$(ReferenceFoundatioSource)' == 'true'" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public override Task WillUseLocalCache()
[Fact(Skip = "Skipping for now until we figure out a timing issue")]
public override Task WillExpireRemoteItems()
{
Log.MinimumLevel = LogLevel.Trace;
Log.DefaultMinimumLevel = LogLevel.Trace;
return base.WillExpireRemoteItems();
}

Expand Down
24 changes: 12 additions & 12 deletions tests/Foundatio.Redis.Tests/Locks/RedisLockTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Foundatio.Caching;
Expand Down Expand Up @@ -66,17 +66,17 @@ public override Task CanAcquireLocksInParallel()
return base.CanAcquireLocksInParallel();
}

// [Fact]
// public override Task CanAcquireScopedLocksInParallel()
// {
// return base.CanAcquireScopedLocksInParallel();
// }
//
// [Fact]
// public override Task CanAcquireMultipleLocksInParallel()
// {
// return base.CanAcquireMultipleLocksInParallel();
// }
[Fact]
public override Task CanAcquireScopedLocksInParallel()
{
return base.CanAcquireScopedLocksInParallel();
}

[Fact]
public override Task CanAcquireMultipleLocksInParallel()
{
return base.CanAcquireMultipleLocksInParallel();
}

[Fact]
public override Task CanAcquireMultipleScopedResources()
Expand Down

0 comments on commit e69fdc6

Please sign in to comment.