Skip to content

Commit

Permalink
- initial async / await implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
eben-roux committed Feb 5, 2024
0 parents commit 96a077a
Show file tree
Hide file tree
Showing 16 changed files with 511 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
.vs

# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
[Dd]eployment

# mstest test results
TestResults

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug/
[Rr]elease/
x64/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.log
*.vspscc
*.vssscc
.builds

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
*.DotSettings

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
packages

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
[Bb]in
[Oo]bj
sql
TestResults
[Tt]est[Rr]esult*
*.Cache
ClientBin
[Ss]tyle[Cc]op.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
Binary file added .media/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2017, Eben Roux
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

Neither the name of the Shuttle organization nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Purge Inbox

```
PM> Install-Package Shuttle.Esb.PurgeInbox
```

The PurgeInbox module for Shuttle.Esb clears the inbox work queue upon startup.

The module will attach the `PurgeInboxObserver` to the `OnAfterConfigure` event of the `StartupPipeline` and purges the inbox work queue if the relevant queue implementation has implemented the `IPurgeQueue` interface. If the inbox work queue implementation has *not* implemented the `IPurgeQueue` interface the purge is ignored.

## Configuration

```c#
services.AddPurgeInboxModule();
```
31 changes: 31 additions & 0 deletions Shuttle.Esb.PurgeInbox.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2020
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shuttle.Esb.PurgeInbox", "Shuttle.Esb.PurgeInbox\Shuttle.Esb.PurgeInbox.csproj", "{AC4D6908-51E2-4F77-A20B-8FEA99DB3763}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A0D4D7E6-8F2F-46B4-98A9-B857D976B322}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AC4D6908-51E2-4F77-A20B-8FEA99DB3763}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC4D6908-51E2-4F77-A20B-8FEA99DB3763}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC4D6908-51E2-4F77-A20B-8FEA99DB3763}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC4D6908-51E2-4F77-A20B-8FEA99DB3763}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DE0BDB61-1259-4C15-959E-B58EBD5EAF64}
EndGlobalSection
EndGlobal
22 changes: 22 additions & 0 deletions Shuttle.Esb.PurgeInbox/.package/AssemblyInfo.cs.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Reflection;
using System.Runtime.InteropServices;

#if NETFRAMEWORK
[assembly: AssemblyTitle(".NET Framework")]
#endif

#if NETCOREAPP
[assembly: AssemblyTitle(".NET Core")]
#endif

#if NETSTANDARD
[assembly: AssemblyTitle(".NET Standard")]
#endif

[assembly: AssemblyVersion("#{SemanticVersionCore}#.0")]
[assembly: AssemblyCopyright("Copyright (c) #{Year}#, Eben Roux")]
[assembly: AssemblyProduct("Shuttle.Esb.PurgeInbox")]
[assembly: AssemblyCompany("Eben Roux")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyInformationalVersion("#{SemanticVersion}#")]
[assembly: ComVisible(false)]
Binary file not shown.
12 changes: 12 additions & 0 deletions Shuttle.Esb.PurgeInbox/.package/Shuttle.NuGetPackager.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PackageTasksPath Condition="'$(PackageTasksPath)' == ''">Shuttle.NuGetPackager.MSBuild.dll</PackageTasksPath>
</PropertyGroup>

<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.Prompt" />
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.RegexFindAndReplace" />
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.NuGet.SetNuGetPackageVersions" />
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.Zip" />
<UsingTask AssemblyFile="$(PackageTasksPath)" TaskName="Shuttle.NuGetPackager.MSBuild.NuGet.SemanticVersion" />
</Project>
104 changes: 104 additions & 0 deletions Shuttle.Esb.PurgeInbox/.package/package.msbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Version" ToolsVersion="15">
<PropertyGroup>
<PackageName>Shuttle.Esb.PurgeInbox</PackageName>
<PackageSource Condition="$(PackageSource) == ''">https://www.nuget.org</PackageSource>
<Configuration Condition="$(Configuration) == ''">Release</Configuration>
</PropertyGroup>

<Import Project="Shuttle.NuGetPackager.targets" />

<ItemGroup>
<ProjectReference Include="..\$(PackageName).csproj" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(ProjectReference)" Targets="Rebuild" Properties="Configuration=Debug;Platform=AnyCPU" />
<MSBuild Projects="@(ProjectReference)" Targets="Rebuild" Properties="Configuration=Release;Platform=AnyCPU" />
</Target>

<Target Name="Version">
<Prompt Text="Enter semantic version:" Condition="$(SemanticVersion) == ''">
<Output TaskParameter="UserInput" PropertyName="SemanticVersion" />
</Prompt>

<Error Text="Please enter a version number." Condition="$(SemanticVersion) == ''" />

<SemanticVersion Value="$(SemanticVersion)">
<Output TaskParameter="VersionCore" PropertyName="SemanticVersionCore" />
<Output TaskParameter="Prerelease" PropertyName="SemanticVersionPrerelease" />
<Output TaskParameter="BuildMetadata" PropertyName="SemanticVersionBuildMetadata" />
</SemanticVersion>

<Copy SourceFiles="AssemblyInfo.cs.template" DestinationFiles="..\Properties\AssemblyInfo.cs" SkipUnchangedFiles="false" />

<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{SemanticVersionCore\}#"
ReplacementText="$(SemanticVersionCore)" />
<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{SemanticVersion\}#"
ReplacementText="$(SemanticVersion)" />
<RegexFindAndReplace Files="..\Properties\AssemblyInfo.cs" FindExpression="#\{Year\}#"
ReplacementText="$([System.DateTime]::Now.ToString(`yyyy`))" />

<Copy SourceFiles="package.nuspec.template" DestinationFiles="package.nuspec" SkipUnchangedFiles="false" />

<RegexFindAndReplace Files="package.nuspec" FindExpression="#\{SemanticVersion\}#"
ReplacementText="$(SemanticVersion)" />
<RegexFindAndReplace Files="package.nuspec" FindExpression="#\{Year\}#"
ReplacementText="$([System.DateTime]::Now.ToString(`yyyy`))" />

<SetNuGetPackageVersions Files="package.nuspec" ProjectFile="..\$(PackageName).csproj" />
</Target>

<Target Name="Pack" DependsOnTargets="Build">
<Error
Text="Before executing the 'Package' target first execute the 'Version' target to set the relevant semantic version in all applicable files."
Condition="!Exists('package.nuspec')" />

<ItemGroup>
<NuGetBinaries Include="..\bin\$(Configuration)\**\$(PackageName).dll" />
</ItemGroup>

<RemoveDir Directories="release" />

<Copy SourceFiles="package.nuspec" DestinationFolder="release\" SkipUnchangedFiles="false" />
<Copy SourceFiles="@(NuGetBinaries)" DestinationFolder="release\lib\%(RecursiveDir)" SkipUnchangedFiles="false" />

<Exec Command="nuget pack release\package.nuspec -OutputDirectory release -NoPackageAnalysis" />
</Target>

<Target Name="Push" DependsOnTargets="Version">
<MSBuild
Projects="$(MSBuildProjectFile)"
Targets="Pack"
Properties="SemanticVersion=$(SemanticVersion)" />

<Exec
Command="nuget push release\$(PackageName).$(SemanticVersion).nupkg -source $(PackageSource)" />
</Target>

<Target Name="Bump" DependsOnTargets="Version">
<MSBuild
Projects="$(MSBuildProjectFile)"
Targets="Pack"
Properties="SemanticVersion=$(SemanticVersion)" />

<ItemGroup>
<PackageFile Include="release\$(PackageName).*.nupkg" />
</ItemGroup>

<MakeDir Directories="$(NuGetPackageSourceFolder)" Condition="$(NuGetPackageSourceFolder) != ''" />

<Copy
SourceFiles="@(PackageFile)"
DestinationFolder="$(NuGetPackageSourceFolder)"
SkipUnchangedFiles="false"
Condition="$(NuGetPackageSourceFolder) != ''" />
</Target>

<Target Name="Flush">
<ItemGroup>
<PackageFolder Include="$(UserProfile)\.nuget\packages\$(PackageName)" />
</ItemGroup>

<RemoveDir Directories="@(PackageFolder)" />
</Target>
</Project>
27 changes: 27 additions & 0 deletions Shuttle.Esb.PurgeInbox/.package/package.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>

<package>
<metadata>
<id>Shuttle.Esb.PurgeInbox</id>
<version>14.0.0</version>
<authors>Eben Roux</authors>
<owners>Eben Roux</owners>
<license type="expression">BSD-3-Clause</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<icon>images\logo.png</icon>
<readme>docs\README.md</readme>
<repository type="git" url="https://github.com/shuttle/Shuttle.Esb.PurgeInbox.git" />
<projectUrl>https://github.com/shuttle/Shuttle.Esb.PurgeInbox</projectUrl>
<description>The PurgeInbox extension clears the inbox work queue upon startup.</description>
<copyright>Copyright (c) 2024, Eben Roux</copyright>
<tags></tags>
<dependencies>
<dependency id="Shuttle.Esb" version="13.2.1" />
</dependencies>
</metadata>
<files>
<file src="..\..\..\.media\logo.png" target="images" />
<file src="..\..\..\README.md" target="docs" />
<file src="lib\**\*.*" target="lib" />
</files>
</package>
27 changes: 27 additions & 0 deletions Shuttle.Esb.PurgeInbox/.package/package.nuspec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>

<package>
<metadata>
<id>Shuttle.Esb.PurgeInbox</id>
<version>#{SemanticVersion}#</version>
<authors>Eben Roux</authors>
<owners>Eben Roux</owners>
<license type="expression">BSD-3-Clause</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<icon>images\logo.png</icon>
<readme>docs\README.md</readme>
<repository type="git" url="https://github.com/shuttle/Shuttle.Esb.PurgeInbox.git" />
<projectUrl>https://github.com/shuttle/Shuttle.Esb.PurgeInbox</projectUrl>
<description>The PurgeInbox extension clears the inbox work queue upon startup.</description>
<copyright>Copyright (c) #{Year}#, Eben Roux</copyright>
<tags></tags>
<dependencies>
#{Dependencies}#
</dependencies>
</metadata>
<files>
<file src="..\..\..\.media\logo.png" target="images" />
<file src="..\..\..\README.md" target="docs" />
<file src="lib\**\*.*" target="lib" />
</files>
</package>
Loading

0 comments on commit 96a077a

Please sign in to comment.