Skip to content

Commit

Permalink
Added filter example to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gregyjames committed Feb 18, 2024
1 parent cf1fe79 commit b026bc2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![NuGet Version](https://img.shields.io/nuget/v/ReQueue)

# ReQueue
C# Library to use a redis list for asynchronous messaging. Perfect for small projects you don't want to set up RabbitMQ for.
C# Library to use a redis list for asynchronous messaging. Perfect for small projects you don't want to set up RabbitMQ for. Try using it with a fast redis implemetation like [Dragonfly](https://github.com/dragonflydb/dragonfly).

# Example
## Object
Expand Down Expand Up @@ -53,7 +53,22 @@ internal class Program
}
}
```
## Filter Example
```csharp
queue.DequeueMessages("numQueue", new Action<Data>(x => {
Console.WriteLine($"Recieved -> {x.Foo}");
}), tokenSource.Token, new Func<Data, bool>((data) => {
if (data != null)
{
if (data.Foo % 2 == 0)
{
return true;
}
}

return false;
}));
```
# License
MIT License

Expand Down

0 comments on commit b026bc2

Please sign in to comment.