├── .gitattributes ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .paket ├── paket.bootstrapper.exe └── paket.targets ├── .travis.yml ├── FSharp.DataProcessingPipelines.sln ├── LICENSE ├── LICENSE.txt ├── README.md ├── README.md.template ├── RELEASE_NOTES.md ├── appveyor.yml ├── build.cmd ├── build.fsx ├── build.sh ├── docs ├── content │ ├── index.fsx │ └── tutorial.fsx ├── files │ └── img │ │ ├── logo-template.pdn │ │ ├── logo.png │ │ ├── pipes-filters01.png │ │ ├── pipes-filters02.png │ │ └── rabbitmq-example01.png └── tools │ ├── generate.fsx │ └── templates │ └── template.cshtml ├── lib └── README.md ├── paket.dependencies ├── paket.lock ├── src ├── FSharp.DataProcessingPipelines.Azure.ServiceBus │ ├── AssemblyInfo.fs │ ├── AzureServiceBus.fs │ ├── FSharp.DataProcessingPipelines.Azure.ServiceBus.fsproj │ ├── Script.fsx │ ├── app.config.install.xdt │ ├── paket.references │ └── web.config.install.xdt ├── FSharp.DataProcessingPipelines.Core │ ├── AssemblyInfo.fs │ ├── FSharp.DataProcessingPipelines.Core.fsproj │ ├── Filters.fs │ ├── Messages.fs │ ├── Pipes.fs │ ├── Runners.fs │ ├── Script.fsx │ ├── paket.references │ └── paket.template └── FSharp.DataProcessingPipelines.RabbitMQ │ ├── AssemblyInfo.fs │ ├── FSharp.DataProcessingPipelines.RabbitMQ.fsproj │ ├── RabbitMQModule.fs │ ├── Script.fsx │ ├── paket.references │ └── paket.template └── tests ├── FSharp.DataProcessingPipelines.RabbitMQ.Tests ├── App.config ├── AssemblyInfo.fs ├── FSharp.DataProcessingPipelines.RabbitMQ.Tests.fsproj ├── Program.fs └── paket.references └── FSharp.DataProcessingPipelines.Tests ├── FSharp.DataProcessingPipelines.Tests.fsproj ├── Tests.fs ├── app.config └── paket.references /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp text=auto eol=lf 6 | *.vb diff=csharp text=auto eol=lf 7 | *.fs diff=csharp text=auto eol=lf 8 | *.fsi diff=csharp text=auto eol=lf 9 | *.fsx diff=csharp text=auto eol=lf 10 | *.sln text eol=crlf merge=union 11 | *.csproj merge=union 12 | *.vbproj merge=union 13 | *.fsproj merge=union 14 | *.dbproj merge=union 15 | 16 | # Standard to msysgit 17 | *.doc diff=astextplain 18 | *.DOC diff=astextplain 19 | *.docx diff=astextplain 20 | *.DOCX diff=astextplain 21 | *.dot diff=astextplain 22 | *.DOT diff=astextplain 23 | *.pdf diff=astextplain 24 | *.PDF diff=astextplain 25 | *.rtf diff=astextplain 26 | *.RTF diff=astextplain 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | Please provide a succinct description of your issue. 4 | 5 | ### Repro steps 6 | 7 | Please provide the steps required to reproduce the problem 8 | 9 | 1. Step A 10 | 11 | 2. Step B 12 | 13 | ### Expected behavior 14 | 15 | Please provide a description of the behavior you expect. 16 | 17 | ### Actual behavior 18 | 19 | Please provide a description of the actual behavior you observe. 20 | 21 | ### Known workarounds 22 | 23 | Please provide a description of any known workarounds. 24 | 25 | ### Related information 26 | 27 | * Operating system 28 | * Branch 29 | * .NET Runtime, CoreCLR or Mono Version 30 | * Performance information, links to performance testing scripts 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # Xamarin Studio / monodevelop user-specific 11 | *.userprefs 12 | *.dll.mdb 13 | *.exe.mdb 14 | 15 | # Build results 16 | 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | build/ 25 | [Bb]in/ 26 | [Oo]bj/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | artifacts/ 49 | 50 | *_i.c 51 | *_p.c 52 | *_i.h 53 | *.ilk 54 | *.meta 55 | *.obj 56 | *.pch 57 | *.pdb 58 | *.pgc 59 | *.pgd 60 | *.rsp 61 | *.sbr 62 | *.tlb 63 | *.tli 64 | *.tlh 65 | *.tmp 66 | *.tmp_proj 67 | *.log 68 | *.vspscc 69 | *.vssscc 70 | .builds 71 | *.pidb 72 | *.svclog 73 | *.log 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | 88 | # Visual Studio profiler 89 | *.psess 90 | *.vsp 91 | *.vspx 92 | 93 | # Other Visual Studio data 94 | .vs/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | *.ncrunch* 115 | .*crunch*.local.xml 116 | 117 | # Installshield output folder 118 | [Ee]xpress/ 119 | 120 | # DocProject is a documentation generator add-in 121 | DocProject/buildhelp/ 122 | DocProject/Help/*.HxT 123 | DocProject/Help/*.HxC 124 | DocProject/Help/*.hhc 125 | DocProject/Help/*.hhk 126 | DocProject/Help/*.hhp 127 | DocProject/Help/Html2 128 | DocProject/Help/html 129 | 130 | # Click-Once directory 131 | publish/ 132 | 133 | # Publish Web Output 134 | *.Publish.xml 135 | 136 | # Enable nuget.exe in the .nuget folder (though normally executables are not tracked) 137 | !.nuget/NuGet.exe 138 | 139 | # Windows Azure Build Output 140 | csx 141 | *.build.csdef 142 | 143 | # Windows Store app package directory 144 | AppPackages/ 145 | 146 | # Others 147 | sql/ 148 | *.Cache 149 | ClientBin/ 150 | [Ss]tyle[Cc]op.* 151 | ~$* 152 | *~ 153 | *.dbmdl 154 | *.[Pp]ublish.xml 155 | *.pfx 156 | *.publishsettings 157 | 158 | # RIA/Silverlight projects 159 | Generated_Code/ 160 | 161 | # Backup & report files from converting an old project file to a newer 162 | # Visual Studio version. Backup files are not needed, because we have git ;-) 163 | _UpgradeReport_Files/ 164 | Backup*/ 165 | UpgradeLog*.XML 166 | UpgradeLog*.htm 167 | 168 | # SQL Server files 169 | App_Data/*.mdf 170 | App_Data/*.ldf 171 | 172 | 173 | #LightSwitch generated files 174 | GeneratedArtifacts/ 175 | _Pvt_Extensions/ 176 | ModelManifest.xml 177 | 178 | # ========================= 179 | # Windows detritus 180 | # ========================= 181 | 182 | # Windows image file caches 183 | Thumbs.db 184 | ehthumbs.db 185 | 186 | # Folder config file 187 | Desktop.ini 188 | 189 | # Recycle Bin used on file shares 190 | $RECYCLE.BIN/ 191 | 192 | # Mac desktop service store files 193 | .DS_Store 194 | 195 | # =================================================== 196 | # Exclude F# project specific directories and files 197 | # =================================================== 198 | 199 | # NuGet Packages Directory 200 | packages/ 201 | 202 | # Generated documentation folder 203 | docs/output/ 204 | 205 | # Temp folder used for publishing docs 206 | temp/ 207 | 208 | # Test results produced by build 209 | TestResults.xml 210 | 211 | # Nuget outputs 212 | nuget/*.nupkg 213 | release.cmd 214 | release.sh 215 | localpackages/ 216 | paket-files 217 | *.orig 218 | .paket/paket.exe 219 | docs/content/license.md 220 | docs/content/release-notes.md 221 | .fake 222 | docs/tools/FSharp.Formatting.svclog 223 | 224 | # Local Configuration Files 225 | config.local.txt 226 | 227 | -------------------------------------------------------------------------------- /.paket/paket.bootstrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/.paket/paket.bootstrapper.exe -------------------------------------------------------------------------------- /.paket/paket.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | true 8 | $(MSBuildThisFileDirectory) 9 | $(MSBuildThisFileDirectory)..\ 10 | 11 | 12 | 13 | $(PaketToolsPath)paket.exe 14 | $(PaketToolsPath)paket.bootstrapper.exe 15 | "$(PaketExePath)" 16 | mono --runtime=v4.0.30319 "$(PaketExePath)" 17 | "$(PaketBootStrapperExePath)" 18 | mono --runtime=v4.0.30319 $(PaketBootStrapperExePath) 19 | 20 | $(PaketCommand) restore 21 | $(PaketBootStrapperCommand) 22 | 23 | RestorePackages; $(BuildDependsOn); 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | 3 | sudo: false # use the new container-based Travis infrastructure 4 | 5 | before_install: 6 | - chmod +x build.sh 7 | 8 | script: 9 | - ./build.sh All 10 | -------------------------------------------------------------------------------- /FSharp.DataProcessingPipelines.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}" 7 | ProjectSection(SolutionItems) = preProject 8 | paket.dependencies = paket.dependencies 9 | paket.lock = paket.lock 10 | EndProjectSection 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{83F16175-43B1-4C90-A1EE-8E351C33435D}" 15 | ProjectSection(SolutionItems) = preProject 16 | docs\tools\generate.fsx = docs\tools\generate.fsx 17 | docs\tools\templates\template.cshtml = docs\tools\templates\template.cshtml 18 | EndProjectSection 19 | EndProject 20 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D5255-776D-4B61-85F9-73C37AA1FB9A}" 21 | ProjectSection(SolutionItems) = preProject 22 | docs\content\index.fsx = docs\content\index.fsx 23 | docs\content\tutorial.fsx = docs\content\tutorial.fsx 24 | EndProjectSection 25 | EndProject 26 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}" 27 | ProjectSection(SolutionItems) = preProject 28 | build.fsx = build.fsx 29 | README.md = README.md 30 | RELEASE_NOTES.md = RELEASE_NOTES.md 31 | EndProjectSection 32 | EndProject 33 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ED8079DD-2B06-4030-9F0F-DC548F98E1C4}" 34 | EndProject 35 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DataProcessingPipelines.Tests", "tests\FSharp.DataProcessingPipelines.Tests\FSharp.DataProcessingPipelines.Tests.fsproj", "{DC84595B-22D2-463C-BCD1-E7476CB80F8C}" 36 | EndProject 37 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DataProcessingPipelines.Core", "src\FSharp.DataProcessingPipelines.Core\FSharp.DataProcessingPipelines.Core.fsproj", "{DD56D434-1724-4BD4-AC8F-9A8E705EB7C1}" 38 | EndProject 39 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Supported Integrations", "Supported Integrations", "{B58B7267-7580-4A44-96F8-283634212CC8}" 40 | EndProject 41 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DataProcessingPipelines.RabbitMQ", "src\FSharp.DataProcessingPipelines.RabbitMQ\FSharp.DataProcessingPipelines.RabbitMQ.fsproj", "{01BACBB1-AE8D-4203-BAC6-3B713CFACF80}" 42 | EndProject 43 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DataProcessingPipelines.Azure.ServiceBus", "src\FSharp.DataProcessingPipelines.Azure.ServiceBus\FSharp.DataProcessingPipelines.Azure.ServiceBus.fsproj", "{8CD79A05-0A70-4164-9065-43C60F1BA53E}" 44 | EndProject 45 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DataProcessingPipelines.RabbitMQ.Tests", "tests\FSharp.DataProcessingPipelines.RabbitMQ.Tests\FSharp.DataProcessingPipelines.RabbitMQ.Tests.fsproj", "{4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2}" 46 | EndProject 47 | Global 48 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 49 | Debug|Any CPU = Debug|Any CPU 50 | Release|Any CPU = Release|Any CPU 51 | EndGlobalSection 52 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 53 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 54 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C}.Debug|Any CPU.Build.0 = Debug|Any CPU 55 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C}.Release|Any CPU.ActiveCfg = Release|Any CPU 56 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C}.Release|Any CPU.Build.0 = Release|Any CPU 57 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 58 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1}.Debug|Any CPU.Build.0 = Debug|Any CPU 59 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1}.Release|Any CPU.ActiveCfg = Release|Any CPU 60 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1}.Release|Any CPU.Build.0 = Release|Any CPU 61 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 62 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80}.Debug|Any CPU.Build.0 = Debug|Any CPU 63 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80}.Release|Any CPU.ActiveCfg = Release|Any CPU 64 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80}.Release|Any CPU.Build.0 = Release|Any CPU 65 | {8CD79A05-0A70-4164-9065-43C60F1BA53E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 66 | {8CD79A05-0A70-4164-9065-43C60F1BA53E}.Debug|Any CPU.Build.0 = Debug|Any CPU 67 | {8CD79A05-0A70-4164-9065-43C60F1BA53E}.Release|Any CPU.ActiveCfg = Release|Any CPU 68 | {8CD79A05-0A70-4164-9065-43C60F1BA53E}.Release|Any CPU.Build.0 = Release|Any CPU 69 | {4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 70 | {4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2}.Debug|Any CPU.Build.0 = Debug|Any CPU 71 | {4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2}.Release|Any CPU.ActiveCfg = Release|Any CPU 72 | {4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2}.Release|Any CPU.Build.0 = Release|Any CPU 73 | EndGlobalSection 74 | GlobalSection(SolutionProperties) = preSolution 75 | HideSolutionNode = FALSE 76 | EndGlobalSection 77 | GlobalSection(NestedProjects) = preSolution 78 | {83F16175-43B1-4C90-A1EE-8E351C33435D} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1} 79 | {8E6D5255-776D-4B61-85F9-73C37AA1FB9A} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1} 80 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4} 81 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80} = {B58B7267-7580-4A44-96F8-283634212CC8} 82 | {8CD79A05-0A70-4164-9065-43C60F1BA53E} = {B58B7267-7580-4A44-96F8-283634212CC8} 83 | {4E63C011-32F8-48FE-A0FA-AEA0AF27F9B2} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4} 84 | EndGlobalSection 85 | EndGlobal 86 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build status](https://ci.appveyor.com/api/projects/status/1skn6mpe3x91ipfs/branch/master?svg=true)](https://ci.appveyor.com/project/marcio-azevedo/fsharp-data-processing-pipeline/branch/master) 2 | [![NuGet Version](https://img.shields.io/nuget/v/FSharp.DataProcessingPipelines.Core.svg?style=flat)](https://www.nuget.org/packages/FSharp.DataProcessingPipelines.Core/) 3 | [![NuGet Version](https://img.shields.io/nuget/v/FSharp.DataProcessingPipelines.RabbitMQ.svg?style=flat)](https://www.nuget.org/packages/FSharp.DataProcessingPipelines.RabbitMQ/) 4 | 5 | # Easily build data processing pipelines in F# # 6 | Provides an extensible solution for creating Data Processing Pipelines in F#. 7 | 8 | ---------- 9 | 10 | This solution offers the basic infrastructure to build data processing pipelines in F# (or C# due to it's interoperability with F#). 11 | 12 | The implementation is based on the [Pipes and Filters Pattern](https://msdn.microsoft.com/en-us/library/dn568100.aspx). The goal is to provide the basic Infrastructure as well as some External Interfaces implementations to allow an easy and fast setup of a typical Data Processing Pipeline, following Pipes and Filters pattern. 13 | 14 | The typical scenario for establishing communication between Pipes and Filters is by providing integration with Queues, so if you have a scenario like this: 15 | 16 | ![](/docs/files/img/pipes-filters01.png) 17 | 18 | You can implement an External Integration with a typical Messaging Queue System and you get a Pub/Sub system (Event-oriented): 19 | 20 | ![](/docs/files/img/pipes-filters02.png) 21 | 22 | The project [FSharp.DataProcessingPipelines.Core](/src/FSharp.DataProcessingPipelines.Core/) provides the basic definition of the Core Entities like Messages, Pipes, Filters and Runners. 23 | 24 | ### [Currently supported integrations](../../wiki/2.-Supported-Integrations/) ### 25 | 26 | For more details about how to use / extend this see the [Wiki](../../wiki/). If you find any issues, please report in [Issues](../../issues/). 27 | 28 | **This is a open source project from and for the community so feel free to contribute (don't forget to send your contact) - just pick a task in [Trello Project](https://trello.com/b/JlE1RNwN/f-data-processing-pipeline)!** 29 | 30 | **Note**: The solution structure is based on the [prototypical .NET solution (file system layout and tooling), recommended by the F# Foundation.](https://github.com/fsprojects/ProjectScaffold/). 31 | -------------------------------------------------------------------------------- /README.md.template: -------------------------------------------------------------------------------- 1 | [![Issue Stats](http://issuestats.com/github/fsprojects/ProjectScaffold/badge/issue)](http://issuestats.com/github/fsprojects/ProjectScaffold) 2 | [![Issue Stats](http://issuestats.com/github/fsprojects/ProjectScaffold/badge/pr)](http://issuestats.com/github/fsprojects/ProjectScaffold) 3 | 4 | # ProjectScaffold 5 | 6 | This project can be used to scaffold a prototypical .NET solution including file system layout and tooling. This includes a build process that: 7 | 8 | * updates all AssemblyInfo files 9 | * compiles the application and runs all test projects 10 | * generates [SourceLinks](https://github.com/ctaggart/SourceLink) 11 | * generates API docs based on XML document tags 12 | * generates [documentation based on Markdown files](http://fsprojects.github.io/ProjectScaffold/writing-docs.html) 13 | * generates [NuGet](http://www.nuget.org) packages 14 | * and allows a simple [one step release process](http://fsprojects.github.io/ProjectScaffold/release-process.html). 15 | 16 | In order to start the scaffolding process run 17 | 18 | > build.cmd // on windows 19 | $ ./build.sh // on unix 20 | 21 | Read the [Getting started tutorial](http://fsprojects.github.io/ProjectScaffold/index.html#Getting-started) to learn more. 22 | 23 | Documentation: http://fsprojects.github.io/ProjectScaffold 24 | 25 | 26 | ## Build Status 27 | 28 | Mono | .NET 29 | ---- | ---- 30 | [![Mono CI Build Status](https://img.shields.io/travis/fsprojects/ProjectScaffold/master.svg)](https://travis-ci.org/fsprojects/ProjectScaffold) | [![.NET Build Status](https://img.shields.io/appveyor/ci/fsgit/ProjectScaffold/master.svg)](https://ci.appveyor.com/project/fsgit/projectscaffold) 31 | 32 | ## Maintainer(s) 33 | 34 | - [@forki](https://github.com/forki) 35 | - [@pblasucci](https://github.com/pblasucci) 36 | - [@sergey-tihon](https://github.com/sergey-tihon) 37 | 38 | The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management) 39 | -------------------------------------------------------------------------------- /RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 - May 3 2016 2 | * Finish first supported integration with RabbitMQ (via EasyNetQ) 3 | 4 | #### 0.0.2-beta - May 3 2016 5 | * Improved quality of solution-wide README.md files 6 | 7 | #### 0.0.1-beta - April 11 2016 8 | * Changed name from fsharp-project-scaffold to FSharp.ProjectScaffold 9 | * Initial release 10 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | init: 2 | - git config --global core.autocrlf input 3 | build_script: 4 | - cmd: build.cmd 5 | test: off 6 | version: 0.0.1.{build} 7 | artifacts: 8 | - path: bin 9 | name: bin 10 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | .paket\paket.bootstrapper.exe 5 | if errorlevel 1 ( 6 | exit /b %errorlevel% 7 | ) 8 | 9 | .paket\paket.exe restore 10 | if errorlevel 1 ( 11 | exit /b %errorlevel% 12 | ) 13 | 14 | IF NOT EXIST build.fsx ( 15 | .paket\paket.exe update 16 | packages\build\FAKE\tools\FAKE.exe init.fsx 17 | ) 18 | packages\build\FAKE\tools\FAKE.exe build.fsx %* 19 | -------------------------------------------------------------------------------- /build.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // FAKE build script 3 | // -------------------------------------------------------------------------------------- 4 | 5 | #r @"packages/build/FAKE/tools/FakeLib.dll" 6 | open Fake 7 | open Fake.Git 8 | open Fake.AssemblyInfoFile 9 | open Fake.ReleaseNotesHelper 10 | open Fake.UserInputHelper 11 | open System 12 | open System.IO 13 | #if MONO 14 | #else 15 | #load "packages/build/SourceLink.Fake/tools/Fake.fsx" 16 | open SourceLink 17 | #endif 18 | 19 | // -------------------------------------------------------------------------------------- 20 | // START TODO: Provide project-specific details below 21 | // -------------------------------------------------------------------------------------- 22 | 23 | // Information about the project are used 24 | // - for version and project name in generated AssemblyInfo file 25 | // - by the generated NuGet package 26 | // - to run tests and to publish documentation on GitHub gh-pages 27 | // - for documentation, you also need to edit info in "docs/tools/generate.fsx" 28 | 29 | // The name of the project 30 | // (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src') 31 | let project = "FSharp.DataProcessingPipelines.Core" 32 | 33 | // Short summary of the project 34 | // (used as description in AssemblyInfo and as a short summary for NuGet package) 35 | let summary = "Provides an extensible solution for creating Data Processing Pipelines in F#." 36 | 37 | // Longer description of the project 38 | // (used as a description for NuGet package; line breaks are automatically cleaned up) 39 | let description = "Provides an extensible solution for creating Data Processing Pipelines in F#." 40 | 41 | // List of author names (for NuGet package) 42 | let authors = [ "Márcio Azevedo" ] 43 | 44 | // Tags for your project (for NuGet package) 45 | let tags = "data processing pipeline pipelines pipes filters etl fsharp f#" 46 | 47 | // File system information 48 | let solutionFile = "FSharp.DataProcessingPipelines.sln" 49 | 50 | // Pattern specifying assemblies to be tested using NUnit 51 | let testAssemblies = "tests/**/bin/Release/*Tests*.dll" 52 | 53 | // Git configuration (used for publishing documentation in gh-pages branch) 54 | // The profile where the project is posted 55 | let gitOwner = "marcio-azevedo" 56 | let gitHome = "https://github.com/" + gitOwner 57 | 58 | // The name of the project on GitHub 59 | let gitName = "fsharp-data-processing-pipeline" 60 | 61 | // The url for the raw files hosted 62 | let gitRaw = environVarOrDefault "gitRaw" "https://raw.github.com/marcio-azevedo" 63 | 64 | // -------------------------------------------------------------------------------------- 65 | // END TODO: The rest of the file includes standard build steps 66 | // -------------------------------------------------------------------------------------- 67 | 68 | // Read additional information from the release notes document 69 | let release = LoadReleaseNotes "RELEASE_NOTES.md" 70 | 71 | // Helper active pattern for project types 72 | let (|Fsproj|Csproj|Vbproj|Shproj|) (projFileName:string) = 73 | match projFileName with 74 | | f when f.EndsWith("fsproj") -> Fsproj 75 | | f when f.EndsWith("csproj") -> Csproj 76 | | f when f.EndsWith("vbproj") -> Vbproj 77 | | f when f.EndsWith("shproj") -> Shproj 78 | | _ -> failwith (sprintf "Project file %s not supported. Unknown project type." projFileName) 79 | 80 | // Generate assembly info files with the right version & up-to-date information 81 | Target "AssemblyInfo" (fun _ -> 82 | let getAssemblyInfoAttributes projectName = 83 | [ Attribute.Title (projectName) 84 | Attribute.Product project 85 | Attribute.Description summary 86 | Attribute.Version release.AssemblyVersion 87 | Attribute.FileVersion release.AssemblyVersion ] 88 | 89 | let getProjectDetails projectPath = 90 | let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) 91 | ( projectPath, 92 | projectName, 93 | System.IO.Path.GetDirectoryName(projectPath), 94 | (getAssemblyInfoAttributes projectName) 95 | ) 96 | 97 | !! "src/**/*.??proj" 98 | |> Seq.map getProjectDetails 99 | |> Seq.iter (fun (projFileName, projectName, folderName, attributes) -> 100 | match projFileName with 101 | | Fsproj -> CreateFSharpAssemblyInfo (folderName "AssemblyInfo.fs") attributes 102 | | Csproj -> CreateCSharpAssemblyInfo ((folderName "Properties") "AssemblyInfo.cs") attributes 103 | | Vbproj -> CreateVisualBasicAssemblyInfo ((folderName "My Project") "AssemblyInfo.vb") attributes 104 | | Shproj -> () 105 | ) 106 | ) 107 | 108 | // Copies binaries from default VS location to expected bin folder 109 | // But keeps a subdirectory structure for each project in the 110 | // src folder to support multiple project outputs 111 | Target "CopyBinaries" (fun _ -> 112 | !! "src/**/*.??proj" 113 | -- "src/**/*.shproj" 114 | |> Seq.map (fun f -> ((System.IO.Path.GetDirectoryName f) "bin/Release", "bin" (System.IO.Path.GetFileNameWithoutExtension f))) 115 | |> Seq.iter (fun (fromDir, toDir) -> CopyDir toDir fromDir (fun _ -> true)) 116 | ) 117 | 118 | // -------------------------------------------------------------------------------------- 119 | // Clean build results 120 | 121 | Target "Clean" (fun _ -> 122 | CleanDirs ["bin"; "temp"] 123 | ) 124 | 125 | Target "CleanDocs" (fun _ -> 126 | CleanDirs ["docs/output"] 127 | ) 128 | 129 | // -------------------------------------------------------------------------------------- 130 | // Build library & test project 131 | 132 | Target "Build" (fun _ -> 133 | !! solutionFile 134 | #if MONO 135 | |> MSBuildReleaseExt "" [ ("DefineConstants","MONO") ] "Rebuild" 136 | #else 137 | |> MSBuildRelease "" "Rebuild" 138 | #endif 139 | |> ignore 140 | ) 141 | 142 | // -------------------------------------------------------------------------------------- 143 | // Run the unit tests using test runner 144 | 145 | Target "RunTests" (fun _ -> 146 | !! testAssemblies 147 | |> NUnit (fun p -> 148 | { p with 149 | DisableShadowCopy = true 150 | TimeOut = TimeSpan.FromMinutes 20. 151 | OutputFile = "TestResults.xml" }) 152 | ) 153 | 154 | #if MONO 155 | #else 156 | // -------------------------------------------------------------------------------------- 157 | // SourceLink allows Source Indexing on the PDB generated by the compiler, this allows 158 | // the ability to step through the source code of external libraries http://ctaggart.github.io/SourceLink/ 159 | 160 | Target "SourceLink" (fun _ -> 161 | let baseUrl = sprintf "%s/%s/{0}/%%var2%%" gitRaw project 162 | !! "src/**/*.??proj" 163 | -- "src/**/*.shproj" 164 | |> Seq.iter (fun projFile -> 165 | let proj = VsProj.LoadRelease projFile 166 | SourceLink.Index proj.CompilesNotLinked proj.OutputFilePdb __SOURCE_DIRECTORY__ baseUrl 167 | ) 168 | ) 169 | 170 | #endif 171 | 172 | // -------------------------------------------------------------------------------------- 173 | // Build a NuGet package 174 | 175 | Target "NuGet" (fun _ -> 176 | Paket.Pack(fun p -> 177 | { p with 178 | OutputPath = "bin" 179 | Version = release.NugetVersion 180 | ReleaseNotes = toLines release.Notes}) 181 | ) 182 | 183 | Target "PublishNuget" (fun _ -> 184 | Paket.Push(fun p -> 185 | { p with 186 | WorkingDir = "bin" }) 187 | ) 188 | 189 | 190 | // -------------------------------------------------------------------------------------- 191 | // Generate the documentation 192 | 193 | 194 | let fakePath = "packages" "build" "FAKE" "tools" "FAKE.exe" 195 | let fakeStartInfo script workingDirectory args fsiargs environmentVars = 196 | (fun (info: System.Diagnostics.ProcessStartInfo) -> 197 | info.FileName <- System.IO.Path.GetFullPath fakePath 198 | info.Arguments <- sprintf "%s --fsiargs -d:FAKE %s \"%s\"" args fsiargs script 199 | info.WorkingDirectory <- workingDirectory 200 | let setVar k v = 201 | info.EnvironmentVariables.[k] <- v 202 | for (k, v) in environmentVars do 203 | setVar k v 204 | setVar "MSBuild" msBuildExe 205 | setVar "GIT" Git.CommandHelper.gitPath 206 | setVar "FSI" fsiPath) 207 | 208 | /// Run the given buildscript with FAKE.exe 209 | let executeFAKEWithOutput workingDirectory script fsiargs envArgs = 210 | let exitCode = 211 | ExecProcessWithLambdas 212 | (fakeStartInfo script workingDirectory "" fsiargs envArgs) 213 | TimeSpan.MaxValue false ignore ignore 214 | System.Threading.Thread.Sleep 1000 215 | exitCode 216 | 217 | // Documentation 218 | let buildDocumentationTarget fsiargs target = 219 | trace (sprintf "Building documentation (%s), this could take some time, please wait..." target) 220 | let exit = executeFAKEWithOutput "docs/tools" "generate.fsx" fsiargs ["target", target] 221 | if exit <> 0 then 222 | failwith "generating reference documentation failed" 223 | () 224 | 225 | Target "GenerateReferenceDocs" (fun _ -> 226 | // buildDocumentationTarget "-d:RELEASE -d:REFERENCE" "Default" //TODO: uncomment to gernerate ref docs 227 | () 228 | ) 229 | 230 | let generateHelp' fail debug = 231 | let args = 232 | if debug then "--define:HELP" 233 | else "--define:RELEASE --define:HELP" 234 | try 235 | buildDocumentationTarget args "Default" 236 | traceImportant "Help generated" 237 | with 238 | | e when not fail -> 239 | traceImportant "generating help documentation failed" 240 | 241 | let generateHelp fail = 242 | generateHelp' fail false 243 | 244 | Target "GenerateHelp" (fun _ -> 245 | DeleteFile "docs/content/release-notes.md" 246 | CopyFile "docs/content/" "RELEASE_NOTES.md" 247 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md" 248 | 249 | DeleteFile "docs/content/license.md" 250 | CopyFile "docs/content/" "LICENSE.txt" 251 | Rename "docs/content/license.md" "docs/content/LICENSE.txt" 252 | 253 | // generateHelp true // TODO: Uncomment to generate docs 254 | ) 255 | 256 | Target "GenerateHelpDebug" (fun _ -> 257 | DeleteFile "docs/content/release-notes.md" 258 | CopyFile "docs/content/" "RELEASE_NOTES.md" 259 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md" 260 | 261 | DeleteFile "docs/content/license.md" 262 | CopyFile "docs/content/" "LICENSE.txt" 263 | Rename "docs/content/license.md" "docs/content/LICENSE.txt" 264 | 265 | // generateHelp' true true // TODO: Uncomment to generate docs 266 | ) 267 | 268 | Target "KeepRunning" (fun _ -> 269 | use watcher = !! "docs/content/**/*.*" |> WatchChanges (fun changes -> 270 | // generateHelp' true true // TODO: Uncomment to generate docs 271 | () 272 | ) 273 | 274 | traceImportant "Waiting for help edits. Press any key to stop." 275 | 276 | System.Console.ReadKey() |> ignore 277 | 278 | watcher.Dispose() 279 | ) 280 | 281 | Target "GenerateDocs" DoNothing 282 | 283 | let createIndexFsx lang = 284 | let content = """(*** hide ***) 285 | // This block of code is omitted in the generated HTML documentation. Use 286 | // it to define helpers that you do not want to show in the documentation. 287 | #I "../../../bin" 288 | 289 | (** 290 | F# Project Scaffold ({0}) 291 | ========================= 292 | *) 293 | """ 294 | let targetDir = "docs/content" lang 295 | let targetFile = targetDir "index.fsx" 296 | ensureDirectory targetDir 297 | System.IO.File.WriteAllText(targetFile, System.String.Format(content, lang)) 298 | 299 | Target "AddLangDocs" (fun _ -> 300 | let args = System.Environment.GetCommandLineArgs() 301 | if args.Length < 4 then 302 | failwith "Language not specified." 303 | 304 | args.[3..] 305 | |> Seq.iter (fun lang -> 306 | if lang.Length <> 2 && lang.Length <> 3 then 307 | failwithf "Language must be 2 or 3 characters (ex. 'de', 'fr', 'ja', 'gsw', etc.): %s" lang 308 | 309 | let templateFileName = "template.cshtml" 310 | let templateDir = "docs/tools/templates" 311 | let langTemplateDir = templateDir lang 312 | let langTemplateFileName = langTemplateDir templateFileName 313 | 314 | if System.IO.File.Exists(langTemplateFileName) then 315 | failwithf "Documents for specified language '%s' have already been added." lang 316 | 317 | ensureDirectory langTemplateDir 318 | Copy langTemplateDir [ templateDir templateFileName ] 319 | 320 | createIndexFsx lang) 321 | ) 322 | 323 | // -------------------------------------------------------------------------------------- 324 | // Release Scripts 325 | 326 | Target "ReleaseDocs" (fun _ -> 327 | let tempDocsDir = "temp/gh-pages" 328 | CleanDir tempDocsDir 329 | Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir 330 | 331 | CopyRecursive "docs/output" tempDocsDir true |> tracefn "%A" 332 | StageAll tempDocsDir 333 | Git.Commit.Commit tempDocsDir (sprintf "Update generated documentation for version %s" release.NugetVersion) 334 | Branches.push tempDocsDir 335 | ) 336 | 337 | #load "paket-files/build/fsharp/FAKE/modules/Octokit/Octokit.fsx" 338 | open Octokit 339 | 340 | Target "Release" (fun _ -> 341 | let user = 342 | match getBuildParam "github-user" with 343 | | s when not (String.IsNullOrWhiteSpace s) -> s 344 | | _ -> getUserInput "Username: " 345 | let pw = 346 | match getBuildParam "github-pw" with 347 | | s when not (String.IsNullOrWhiteSpace s) -> s 348 | | _ -> getUserPassword "Password: " 349 | let remote = 350 | Git.CommandHelper.getGitResult "" "remote -v" 351 | |> Seq.filter (fun (s: string) -> s.EndsWith("(push)")) 352 | |> Seq.tryFind (fun (s: string) -> s.Contains(gitOwner + "/" + gitName)) 353 | |> function None -> gitHome + "/" + gitName | Some (s: string) -> s.Split().[0] 354 | 355 | StageAll "" 356 | Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion) 357 | Branches.pushBranch "" remote (Information.getBranchName "") 358 | 359 | Branches.tag "" release.NugetVersion 360 | Branches.pushTag "" remote release.NugetVersion 361 | 362 | // release on github 363 | createClient user pw 364 | |> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes 365 | // TODO: |> uploadFile "PATH_TO_FILE" 366 | |> releaseDraft 367 | |> Async.RunSynchronously 368 | ) 369 | 370 | Target "BuildPackage" DoNothing 371 | 372 | // -------------------------------------------------------------------------------------- 373 | // Run all targets by default. Invoke 'build ' to override 374 | 375 | Target "All" DoNothing 376 | 377 | "Clean" 378 | ==> "AssemblyInfo" 379 | ==> "Build" 380 | ==> "CopyBinaries" 381 | ==> "RunTests" 382 | ==> "GenerateReferenceDocs" 383 | ==> "GenerateDocs" 384 | ==> "All" 385 | =?> ("ReleaseDocs",isLocalBuild) 386 | 387 | "All" 388 | #if MONO 389 | #else 390 | =?> ("SourceLink", Pdbstr.tryFind().IsSome ) 391 | #endif 392 | ==> "NuGet" 393 | ==> "BuildPackage" 394 | 395 | "CleanDocs" 396 | ==> "GenerateHelp" 397 | ==> "GenerateReferenceDocs" 398 | ==> "GenerateDocs" 399 | 400 | "CleanDocs" 401 | ==> "GenerateHelpDebug" 402 | 403 | "GenerateHelpDebug" 404 | ==> "KeepRunning" 405 | 406 | "ReleaseDocs" 407 | ==> "Release" 408 | 409 | "BuildPackage" 410 | ==> "PublishNuget" 411 | ==> "Release" 412 | 413 | RunTargetOrDefault "All" 414 | 415 | //Shortened DependencyGraph for Target NuGet: 416 | //<== NuGet 417 | // <== All 418 | // <== GenerateDocs 419 | // <== GenerateReferenceDocs 420 | // <== RunTests 421 | // <== CopyBinaries 422 | // <== Build 423 | // <== AssemblyInfo 424 | // <== Clean 425 | // <== GenerateHelp 426 | // <== CleanDocs 427 | 428 | //The resulting target order is: 429 | // - Clean 430 | // - AssemblyInfo 431 | // - Build 432 | // - CopyBinaries 433 | // - RunTests 434 | // - CleanDocs 435 | // - GenerateHelp 436 | // - GenerateReferenceDocs 437 | // - GenerateDocs 438 | // - All 439 | // - NuGet 440 | 441 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | cd `dirname $0` 7 | 8 | PAKET_BOOTSTRAPPER_EXE=.paket/paket.bootstrapper.exe 9 | PAKET_EXE=.paket/paket.exe 10 | FAKE_EXE=packages/build/FAKE/tools/FAKE.exe 11 | 12 | FSIARGS="" 13 | OS=${OS:-"unknown"} 14 | if [[ "$OS" != "Windows_NT" ]] 15 | then 16 | FSIARGS="--fsiargs -d:MONO" 17 | fi 18 | 19 | function run() { 20 | if [[ "$OS" != "Windows_NT" ]] 21 | then 22 | mono "$@" 23 | else 24 | "$@" 25 | fi 26 | } 27 | 28 | function yesno() { 29 | # NOTE: Defaults to NO 30 | read -p "$1 [y/N] " ynresult 31 | case "$ynresult" in 32 | [yY]*) true ;; 33 | *) false ;; 34 | esac 35 | } 36 | 37 | set +e 38 | run $PAKET_BOOTSTRAPPER_EXE 39 | bootstrapper_exitcode=$? 40 | set -e 41 | 42 | if [[ "$OS" != "Windows_NT" ]] && 43 | [ $bootstrapper_exitcode -ne 0 ] && 44 | [ $(certmgr -list -c Trust | grep X.509 | wc -l) -le 1 ] && 45 | [ $(certmgr -list -c -m Trust | grep X.509 | wc -l) -le 1 ] 46 | then 47 | echo "Your Mono installation has no trusted SSL root certificates set up." 48 | echo "This may result in the Paket bootstrapper failing to download Paket" 49 | echo "because Github's SSL certificate can't be verified. One way to fix" 50 | echo "this issue would be to download the list of SSL root certificates" 51 | echo "from the Mozilla project by running the following command:" 52 | echo "" 53 | echo " mozroots --import --sync" 54 | echo "" 55 | echo "This will import over 100 SSL root certificates into your Mono" 56 | echo "certificate repository." 57 | echo "" 58 | if yesno "Run 'mozroots --import --sync' now?" 59 | then 60 | mozroots --import --sync 61 | else 62 | echo "Attempting to continue without running mozroots. This might fail." 63 | fi 64 | # Re-run bootstrapper whether or not the user ran mozroots, because maybe 65 | # they fixed the problem in a separate terminal window. 66 | run $PAKET_BOOTSTRAPPER_EXE 67 | fi 68 | 69 | run $PAKET_EXE restore 70 | 71 | [ ! -e build.fsx ] && run $PAKET_EXE update 72 | [ ! -e build.fsx ] && run $FAKE_EXE init.fsx 73 | run $FAKE_EXE "$@" $FSIARGS build.fsx 74 | 75 | -------------------------------------------------------------------------------- /docs/content/index.fsx: -------------------------------------------------------------------------------- 1 | (*** hide ***) 2 | // This block of code is omitted in the generated HTML documentation. Use 3 | // it to define helpers that you do not want to show in the documentation. 4 | #I "../../bin" 5 | 6 | (** 7 | FSharp.DataProcessingPipelines 8 | ====================== 9 | 10 | Documentation 11 | 12 |
13 |
14 |
15 |
16 | The FSharp.DataProcessingPipelines library can be installed from NuGet: 17 |
PM> Install-Package FSharp.DataProcessingPipelines
18 |
19 |
20 |
21 |
22 | 23 | Example 24 | ------- 25 | 26 | This example demonstrates using a function defined in this sample library. 27 | 28 | *) 29 | #r "FSharp.DataProcessingPipelines.dll" 30 | open FSharp.DataProcessingPipelines 31 | 32 | printfn "hello = %i" <| Library.hello 0 33 | 34 | (** 35 | Some more info 36 | 37 | Samples & documentation 38 | ----------------------- 39 | 40 | The library comes with comprehensible documentation. 41 | It can include tutorials automatically generated from `*.fsx` files in [the content folder][content]. 42 | The API reference is automatically generated from Markdown comments in the library implementation. 43 | 44 | * [Tutorial](tutorial.html) contains a further explanation of this sample library. 45 | 46 | * [API Reference](reference/index.html) contains automatically generated documentation for all types, modules 47 | and functions in the library. This includes additional brief samples on using most of the 48 | functions. 49 | 50 | Contributing and copyright 51 | -------------------------- 52 | 53 | The project is hosted on [GitHub][gh] where you can [report issues][issues], fork 54 | the project and submit pull requests. If you're adding a new public API, please also 55 | consider adding [samples][content] that can be turned into a documentation. You might 56 | also want to read the [library design notes][readme] to understand how it works. 57 | 58 | The library is available under Public Domain license, which allows modification and 59 | redistribution for both commercial and non-commercial purposes. For more information see the 60 | [License file][license] in the GitHub repository. 61 | 62 | [content]: https://github.com/fsprojects/FSharp.DataProcessingPipelines/tree/master/docs/content 63 | [gh]: https://github.com/fsprojects/FSharp.DataProcessingPipelines 64 | [issues]: https://github.com/fsprojects/FSharp.DataProcessingPipelines/issues 65 | [readme]: https://github.com/fsprojects/FSharp.DataProcessingPipelines/blob/master/README.md 66 | [license]: https://github.com/fsprojects/FSharp.DataProcessingPipelines/blob/master/LICENSE.txt 67 | *) 68 | -------------------------------------------------------------------------------- /docs/content/tutorial.fsx: -------------------------------------------------------------------------------- 1 | (*** hide ***) 2 | // This block of code is omitted in the generated HTML documentation. Use 3 | // it to define helpers that you do not want to show in the documentation. 4 | #I "../../bin" 5 | 6 | (** 7 | Introducing your project 8 | ======================== 9 | 10 | Say more 11 | 12 | *) 13 | #r "FSharp.DataProcessingPipelines.dll" 14 | open FSharp.DataProcessingPipelines 15 | 16 | Library.hello 0 17 | (** 18 | Some more info 19 | *) 20 | -------------------------------------------------------------------------------- /docs/files/img/logo-template.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/docs/files/img/logo-template.pdn -------------------------------------------------------------------------------- /docs/files/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/docs/files/img/logo.png -------------------------------------------------------------------------------- /docs/files/img/pipes-filters01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/docs/files/img/pipes-filters01.png -------------------------------------------------------------------------------- /docs/files/img/pipes-filters02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/docs/files/img/pipes-filters02.png -------------------------------------------------------------------------------- /docs/files/img/rabbitmq-example01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/docs/files/img/rabbitmq-example01.png -------------------------------------------------------------------------------- /docs/tools/generate.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // Builds the documentation from `.fsx` and `.md` files in the 'docs/content' directory 3 | // (the generated documentation is stored in the 'docs/output' directory) 4 | // -------------------------------------------------------------------------------------- 5 | 6 | // Binaries that have XML documentation (in a corresponding generated XML file) 7 | // Any binary output / copied to bin/projectName/projectName.dll will 8 | // automatically be added as a binary to generate API docs for. 9 | // for binaries output to root bin folder please add the filename only to the 10 | // referenceBinaries list below in order to generate documentation for the binaries. 11 | // (This is the original behaviour of ProjectScaffold prior to multi project support) 12 | let referenceBinaries = [] 13 | // Web site location for the generated documentation 14 | let website = "/" 15 | 16 | let githubLink = "http://github.com/marcio-azevedo/fsharp-data-processing-pipeline" 17 | 18 | // Specify more information about your project 19 | let info = 20 | [ "project-name", "FSharp.DataProcessingPipelines" 21 | "project-author", "Márcio Azevedo" 22 | "project-summary", "Provides an extensible solution for creating Data Processing Pipelines in F#." 23 | "project-github", githubLink 24 | "project-nuget", "http://nuget.org/packages/FSharp.DataProcessingPipelines.Core" ] 25 | 26 | // -------------------------------------------------------------------------------------- 27 | // For typical project, no changes are needed below 28 | // -------------------------------------------------------------------------------------- 29 | 30 | #load "../../packages/build/FSharp.Formatting/FSharp.Formatting.fsx" 31 | #I "../../packages/build/FAKE/tools/" 32 | #r "FakeLib.dll" 33 | open Fake 34 | open System.IO 35 | open Fake.FileHelper 36 | open FSharp.Literate 37 | open FSharp.MetadataFormat 38 | 39 | // When called from 'build.fsx', use the public project URL as 40 | // otherwise, use the current 'output' directory. 41 | #if RELEASE 42 | let root = website 43 | #else 44 | let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../output") 45 | #endif 46 | 47 | // Paths with template/source/output locations 48 | let bin = __SOURCE_DIRECTORY__ @@ "../../bin" 49 | let content = __SOURCE_DIRECTORY__ @@ "../content" 50 | let output = __SOURCE_DIRECTORY__ @@ "../output" 51 | let files = __SOURCE_DIRECTORY__ @@ "../files" 52 | let templates = __SOURCE_DIRECTORY__ @@ "templates" 53 | let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/build/FSharp.Formatting/" 54 | let docTemplate = "docpage.cshtml" 55 | 56 | // Where to look for *.csproj templates (in this order) 57 | let layoutRootsAll = new System.Collections.Generic.Dictionary() 58 | layoutRootsAll.Add("en",[ templates; formatting @@ "templates" 59 | formatting @@ "templates/reference" ]) 60 | subDirectories (directoryInfo templates) 61 | |> Seq.iter (fun d -> 62 | let name = d.Name 63 | if name.Length = 2 || name.Length = 3 then 64 | layoutRootsAll.Add( 65 | name, [templates @@ name 66 | formatting @@ "templates" 67 | formatting @@ "templates/reference" ])) 68 | 69 | // Copy static files and CSS + JS from F# Formatting 70 | let copyFiles () = 71 | CopyRecursive files output true |> Log "Copying file: " 72 | ensureDirectory (output @@ "content") 73 | CopyRecursive (formatting @@ "styles") (output @@ "content") true 74 | |> Log "Copying styles and scripts: " 75 | 76 | let binaries = 77 | let manuallyAdded = 78 | referenceBinaries 79 | |> List.map (fun b -> bin @@ b) 80 | 81 | let conventionBased = 82 | directoryInfo bin 83 | |> subDirectories 84 | |> Array.map (fun d -> d.FullName @@ (sprintf "%s.dll" d.Name)) 85 | |> List.ofArray 86 | 87 | conventionBased @ manuallyAdded 88 | 89 | let libDirs = 90 | let conventionBasedbinDirs = 91 | directoryInfo bin 92 | |> subDirectories 93 | |> Array.map (fun d -> d.FullName) 94 | |> List.ofArray 95 | 96 | conventionBasedbinDirs @ [bin] 97 | 98 | // Build API reference from XML comments 99 | let buildReference () = 100 | CleanDir (output @@ "reference") 101 | MetadataFormat.Generate 102 | ( binaries, output @@ "reference", layoutRootsAll.["en"], 103 | parameters = ("root", root)::info, 104 | sourceRepo = githubLink @@ "tree/master", 105 | sourceFolder = __SOURCE_DIRECTORY__ @@ ".." @@ "..", 106 | publicOnly = true,libDirs = libDirs ) 107 | 108 | // Build documentation from `fsx` and `md` files in `docs/content` 109 | let buildDocumentation () = 110 | 111 | // First, process files which are placed in the content root directory. 112 | 113 | Literate.ProcessDirectory 114 | ( content, docTemplate, output, replacements = ("root", root)::info, 115 | layoutRoots = layoutRootsAll.["en"], 116 | generateAnchors = true, 117 | processRecursive = false) 118 | 119 | // And then process files which are placed in the sub directories 120 | // (some sub directories might be for specific language). 121 | 122 | let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.TopDirectoryOnly) 123 | for dir in subdirs do 124 | let dirname = (new DirectoryInfo(dir)).Name 125 | let layoutRoots = 126 | // Check whether this directory name is for specific language 127 | let key = layoutRootsAll.Keys 128 | |> Seq.tryFind (fun i -> i = dirname) 129 | match key with 130 | | Some lang -> layoutRootsAll.[lang] 131 | | None -> layoutRootsAll.["en"] // "en" is the default language 132 | 133 | Literate.ProcessDirectory 134 | ( dir, docTemplate, output @@ dirname, replacements = ("root", root)::info, 135 | layoutRoots = layoutRoots, 136 | generateAnchors = true ) 137 | 138 | // Generate 139 | copyFiles() 140 | #if HELP 141 | buildDocumentation() 142 | #endif 143 | #if REFERENCE 144 | buildReference() 145 | #endif 146 | -------------------------------------------------------------------------------- /docs/tools/templates/template.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | @Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 |
24 |
25 | 29 |

@Properties["project-name"]

30 |
31 |
32 |
33 |
34 | @RenderBody() 35 |
36 |
37 | F# Project 38 | 53 |
54 |
55 |
56 | Fork me on GitHub 57 | 58 | 59 | -------------------------------------------------------------------------------- /lib/README.md: -------------------------------------------------------------------------------- 1 | This file is in the `lib` directory. 2 | 3 | Any **libraries** on which your project depends and which are **NOT managed via NuGet** should be kept **in this directory**. 4 | This typically includes custom builds of third-party software, private (i.e. to a company) codebases, and native libraries. 5 | 6 | --- 7 | NOTE: 8 | 9 | This file is a placeholder, used to preserve directory structure in Git. 10 | 11 | This file does not need to be edited. 12 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://api.nuget.org/v3/index.json 2 | nuget EasyNetQ 3 | nuget RabbitMQ.Client 4 | nuget WindowsAzure.ServiceBus 5 | 6 | group Build 7 | source https://api.nuget.org/v3/index.json 8 | 9 | nuget SourceLink.Fake 10 | nuget FAKE 11 | nuget FSharp.Formatting 12 | 13 | github fsharp/FAKE modules/Octokit/Octokit.fsx 14 | 15 | group Test 16 | source https://api.nuget.org/v3/index.json 17 | 18 | nuget NUnit ~> 2 19 | nuget NUnit.Runners ~> 2 -------------------------------------------------------------------------------- /paket.lock: -------------------------------------------------------------------------------- 1 | NUGET 2 | remote: http://api.nuget.org/v3/index.json 3 | specs: 4 | EasyNetQ (0.57.2.431) 5 | RabbitMQ.Client (>= 3.6) 6 | RabbitMQ.Client (3.6.1) 7 | WindowsAzure.ServiceBus (3.1.7) 8 | 9 | GROUP Build 10 | NUGET 11 | remote: http://api.nuget.org/v3/index.json 12 | specs: 13 | FAKE (4.25.2) 14 | FSharp.Compiler.Service (2.0.0.6) 15 | FSharp.Formatting (2.14.2) 16 | FSharp.Compiler.Service (2.0.0.6) 17 | FSharpVSPowerTools.Core (>= 2.3 < 2.4) 18 | FSharpVSPowerTools.Core (2.3) 19 | FSharp.Compiler.Service (>= 2.0.0.3) 20 | Microsoft.Bcl (1.1.10) - framework: net10, net11, net20, net30, net35, net40, net40-full 21 | Microsoft.Bcl.Build (>= 1.0.14) 22 | Microsoft.Bcl.Build (1.0.21) - import_targets: false, framework: net10, net11, net20, net30, net35, net40, net40-full 23 | Microsoft.Net.Http (2.2.29) - framework: net10, net11, net20, net30, net35, net40, net40-full 24 | Microsoft.Bcl (>= 1.1.10) 25 | Microsoft.Bcl.Build (>= 1.0.14) 26 | Octokit (0.19) 27 | Microsoft.Net.Http 28 | SourceLink.Fake (1.1) 29 | GITHUB 30 | remote: fsharp/FAKE 31 | specs: 32 | modules/Octokit/Octokit.fsx (59dfade480c5f9107107f11af366aaae1f4a9157) 33 | Octokit 34 | GROUP Test 35 | NUGET 36 | remote: http://api.nuget.org/v3/index.json 37 | specs: 38 | NUnit (2.6.4) 39 | NUnit.Runners (2.6.4) 40 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace System 2 | open System.Reflection 3 | 4 | [] 5 | [] 6 | [] 7 | [] 8 | [] 9 | do () 10 | 11 | module internal AssemblyVersionInformation = 12 | let [] Version = "0.1.0" 13 | let [] InformationalVersion = "0.1.0" 14 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/AzureServiceBus.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Infrastructure 2 | 3 | // 4 | //open System 5 | //open System.Globalization 6 | //open System.Threading 7 | //open System.Runtime.Serialization 8 | //open FSharp.DataProcessingPipelines.Core 9 | //open FSharp.DataProcessingPipelines.Core.Pipes 10 | //open Microsoft.ServiceBus 11 | //open Microsoft.ServiceBus.Messaging 12 | 13 | /// Documentation for AzureServiceBus Pipes 14 | /// 15 | /// ## Example 16 | /// 17 | /// let h = Library.hello 1 18 | /// printfn "%d" h 19 | /// 20 | //module AzureServiceBus = 21 | 22 | //http://fsprojects.github.io/FSharp.CloudAgent/tutorial.html 23 | // 24 | // /// OutputPipe type implementation for Azure Service Bus 25 | // type AzureServiceBusOutputPipe<'T when 'T : not struct> (serviceBus:TopicClient, topic:String) = 26 | // 27 | // inherit IOutputPipe<'T> () 28 | // 29 | // let Bus = serviceBus 30 | // let Topic = topic 31 | // 32 | // override this.Publish m = 33 | // try 34 | // let brokeredMessage = new BrokeredMessage() 35 | // Bus.Send(brokeredMessage) 36 | // with 37 | // | ex -> 38 | // // log exception 39 | // reraise() 40 | // 41 | // /// InputPipe type implementation for Azure Service Bus 42 | // type AzureServiceBusInputPipe<'T when 'T : not struct> 43 | // (serviceBus:TopicClient, subscriberId:String, topic:String, locale:String) = 44 | // 45 | // inherit IInputPipe<'T> () 46 | // 47 | // let Bus = serviceBus 48 | // let SubscriberId = subscriberId 49 | // let Topic = topic 50 | // let Locale = locale 51 | // 52 | // override this.Subscribe (handler:('T -> unit)) = 53 | // let InternalHandler (message:'T) = 54 | // Thread.CurrentThread.CurrentCulture <- new CultureInfo(Locale) 55 | // handler message 56 | // try 57 | //// Bus.Subscribe<'T>(SubscriberId, (fun m -> InternalHandler m), (fun x -> x.WithTopic(Topic) |> ignore)) |> ignore 58 | // () 59 | // with 60 | // | ex -> 61 | // // log exception 62 | // reraise() 63 | 64 | // let namespaceManager (connectionString:string) = 65 | // try 66 | // Some (NamespaceManager.CreateFromConnectionString(connectionString)) 67 | // with 68 | // | ex -> 69 | // printfn "%s" (ex.InnerException.Message) 70 | // None 71 | // 72 | // let getQueue (connectionString:string, queueName:string) = 73 | // match (namespaceManager connectionString) with 74 | // | None -> None 75 | // | Some nm -> 76 | // try 77 | // match (nm.QueueExists(queueName)) with 78 | // | false -> Some (nm.CreateQueue(queueName)) 79 | // | true -> Some (nm.GetQueue queueName) 80 | // with 81 | // | ex -> 82 | // (printfn "%s" ex.InnerException.Message) 83 | // None 84 | // 85 | // let getServiceBusclient (connectionString:string, queueName:string) = 86 | // QueueClient.CreateFromConnectionString(connectionString, queueName) 87 | // 88 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/FSharp.DataProcessingPipelines.Azure.ServiceBus.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {8CD79A05-0A70-4164-9065-43C60F1BA53E} 7 | Library 8 | FSharp.DataProcessingPipelines.Azure.ServiceBus 9 | FSharp.DataProcessingPipelines.Azure.ServiceBus 10 | v4.5 11 | 12 | 13 | true 14 | false 15 | bin\Debug 16 | DEBUG 17 | prompt 18 | false 19 | 20 | 21 | bin\Debug\FSharp.DataProcessingPipelines.Azure.ServiceBus.XML 22 | 23 | 24 | false 25 | true 26 | bin\Release 27 | 28 | 29 | prompt 30 | false 31 | true 32 | 33 | 34 | bin\Release\FSharp.DataProcessingPipelines.Azure.ServiceBus.XML 35 | 36 | 37 | 11 38 | 39 | 40 | 41 | 42 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 43 | 44 | 45 | 46 | 47 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | True 56 | 57 | 58 | True 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | ..\..\packages\WindowsAzure.ServiceBus.3.1.7\lib\net45-full\Microsoft.ServiceBus.dll 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1} 77 | FSharp.DataProcessingPipelines.Core 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/Script.fsx: -------------------------------------------------------------------------------- 1 | // Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project 2 | // for more guidance on F# programming. 3 | 4 | #r @"../../packages/WindowsAzure.ServiceBus.3.1.7/lib/net45-full/Microsoft.ServiceBus.dll" 5 | #load "AzureServiceBus.fs" 6 | //#r @"../../packages/Microsoft.WindowsAzure.ConfigurationManager.3.2.1/lib/net40/Microsoft.WindowsAzure.Configuration.dll" 7 | //#r @"../../packages/Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll" 8 | //#r @"../../packages/FSharp.CloudAgent.0.3/lib/net40/FSharp.CloudAgent.dll" 9 | 10 | open System 11 | open System.Runtime.Serialization 12 | open Microsoft.ServiceBus 13 | open Microsoft.ServiceBus.Messaging 14 | open FSharp.DataProcessingPipelines.Infrastructure.AzureServiceBus 15 | 16 | [] 17 | let ServiceBusConnectionString = "host=localhost" //TODO: set an existing Azure host! 18 | // 19 | //// A DTO 20 | //type SampleMessage = { Id : string; Name : string } 21 | // 22 | //let myQueue = AzureServiceBus.getQueue (ServiceBusConnectionString, "TestQueue") 23 | // 24 | //let currentClient = AzureServiceBus.getServiceBusclient (ServiceBusConnectionString, "TestQueue") 25 | // 26 | //let onMessageAction (message:BrokeredMessage) = 27 | // printfn "%s" (message.SessionId) 28 | // () 29 | // 30 | //// Configure the callback options. 31 | //let options = new OnMessageOptions(AutoComplete = false, AutoRenewTimeout = (TimeSpan.FromMinutes(1.0))) 32 | // 33 | //// Callback to handle received messages. 34 | //currentClient.OnMessage((fun (message) -> onMessageAction message), options) 35 | // 36 | //let testMessage = new BrokeredMessage() 37 | //currentClient.Send(testMessage) 38 | // 39 | //// https://azure.microsoft.com/en-us/documentation/articles/service-bus-queues-topics-subscriptions/ 40 | 41 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/app.config.install.xdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/paket.references: -------------------------------------------------------------------------------- 1 | WindowsAzure.ServiceBus -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Azure.ServiceBus/web.config.install.xdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace System 2 | open System.Reflection 3 | 4 | [] 5 | [] 6 | [] 7 | [] 8 | [] 9 | do () 10 | 11 | module internal AssemblyVersionInformation = 12 | let [] Version = "0.1.0" 13 | let [] InformationalVersion = "0.1.0" 14 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/FSharp.DataProcessingPipelines.Core.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1} 7 | Library 8 | FSharp.DataProcessingPipelines.Core 9 | FSharp.DataProcessingPipelines.Core 10 | v4.5 11 | 12 | 13 | true 14 | false 15 | bin\Debug 16 | DEBUG 17 | prompt 18 | false 19 | 20 | 21 | bin\Debug\FSharp.DataProcessingPipelines.Core.XML 22 | 23 | 24 | false 25 | true 26 | bin\Release 27 | 28 | 29 | prompt 30 | false 31 | true 32 | 33 | 34 | bin\Release\FSharp.DataProcessingPipelines.Core.XML 35 | 36 | 37 | 11 38 | 39 | 40 | 41 | 42 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 43 | 44 | 45 | 46 | 47 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/Filters.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Core 2 | 3 | open System 4 | open FSharp.DataProcessingPipelines.Core.Pipes 5 | open FSharp.DataProcessingPipelines.Core.Messages 6 | 7 | module Filters = 8 | 9 | type IFilter () = 10 | 11 | /// Data transformation executed by the Filter 12 | abstract member Execute: unit -> unit 13 | default this.Execute () = () 14 | 15 | /// Filter that executes the data transformation 16 | [] 17 | type Filter<'T, 'V>(input:IInputPipe<'T>, output:IOutputPipe<'V>) = 18 | 19 | /// Executes the data transformation. 20 | inherit IFilter () 21 | 22 | /// Input Pipe 23 | member this.InputPipe = input 24 | 25 | /// Output Pipe 26 | member this.OutputPipe = output 27 | 28 | /// Data Source that triggers the pipeline 29 | [] 30 | type DataSource<'V>(output:IOutputPipe<'V>) = 31 | 32 | /// Executes the data transformation. 33 | inherit IFilter () 34 | 35 | /// Output Pipe 36 | member this.OutputPipe = output 37 | 38 | /// Data Sink that ends the pipeline data transformation 39 | [] 40 | type DataSink<'T>(input:IInputPipe<'T>) = 41 | 42 | /// Executes the data transformation. 43 | inherit IFilter () 44 | 45 | /// Output Pipe 46 | member this.InputPipe = input 47 | 48 | // match (filter:IFilter<'T, 'V>) = 49 | // | Filter :> Filter<'T,'V> -> 50 | // | DataSource :> DataSource<'V> -> 51 | // | DataSink :> DataSink<'T> - > 52 | // | _ -> 53 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/Messages.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Core 2 | 3 | open System 4 | 5 | /// Documentation for Messages 6 | /// 7 | /// ## Example 8 | /// 9 | /// let h = Library.hello 1 10 | /// printfn "%d" h 11 | /// 12 | module Messages = 13 | 14 | type MessageType = 15 | | Debug 16 | | Information 17 | | Warning 18 | | Error 19 | 20 | type ICommandMessage = 21 | 22 | /// Action 23 | abstract member Action : String with get 24 | 25 | /// Type 26 | abstract member Type : MessageType with get 27 | 28 | type IEventMessage = 29 | 30 | /// Action 31 | abstract member Timestamp : DateTime with get 32 | 33 | /// Context 34 | abstract member Context : String with get 35 | 36 | /// Message 37 | abstract member Message : String with get 38 | 39 | /// Type 40 | abstract member Type : MessageType with get 41 | 42 | type EventErrorMessage (e:Exception) = 43 | 44 | member this.Exception = e 45 | 46 | interface IEventMessage with 47 | member this.Context = 48 | e.StackTrace 49 | 50 | member this.Message = 51 | match e.InnerException with 52 | | null -> (e.Message) 53 | | _ -> (e.Message + " - " + e.InnerException.Message) 54 | 55 | member this.Type = MessageType.Error 56 | 57 | member this.Timestamp = DateTime.Now 58 | 59 | type EventWarningMessage (m:String, c:String) = 60 | 61 | interface IEventMessage with 62 | member this.Context = c 63 | 64 | member this.Message = m 65 | 66 | member this.Type = MessageType.Warning 67 | 68 | member this.Timestamp = DateTime.Now 69 | 70 | type EventInformationMessage (m:String, c:String) = 71 | 72 | interface IEventMessage with 73 | member this.Context = c 74 | 75 | member this.Message = m 76 | 77 | member this.Type = MessageType.Information 78 | 79 | member this.Timestamp = DateTime.Now 80 | 81 | 82 | type EventDebugMessage (m:String, c:String) = 83 | 84 | interface IEventMessage with 85 | member this.Context = c 86 | 87 | member this.Message = m 88 | 89 | member this.Type = MessageType.Debug 90 | 91 | member this.Timestamp = DateTime.Now 92 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/Pipes.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Core 2 | 3 | open System 4 | 5 | module Pipes = 6 | 7 | [] 8 | type IInputPipe<'T> () = 9 | 10 | abstract member Subscribe: ('T -> unit) -> unit 11 | 12 | [] 13 | type IOutputPipe<'T> () = 14 | 15 | abstract member Publish: 'T -> unit 16 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/Runners.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Core 2 | 3 | open System 4 | open FSharp.DataProcessingPipelines.Core.Messages 5 | open FSharp.DataProcessingPipelines.Core.Pipes 6 | open FSharp.DataProcessingPipelines.Core.Filters 7 | 8 | module Runners = 9 | 10 | type BaseRunner (filter:IFilter) = 11 | 12 | member this.Filter = filter 13 | 14 | member this.Start () = 15 | // Add some special rule to delay start, or just start the Filter. 16 | (this.Filter.Execute ()) 17 | 18 | // member this.Configuration = new Configuration() 19 | // member this.Logger = new LoggerConfiguration() 20 | // .WriteTo.ColoredConsole() 21 | // .WriteTo.RollingFile(@"C:\Log-{Date}.txt") 22 | // .CreateLogger(); 23 | // 24 | // /// Returns 42 25 | // /// 26 | // /// ## Parameters 27 | // /// - `num` - whatever 28 | // let hello num = 42 -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/Script.fsx: -------------------------------------------------------------------------------- 1 | // Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project 2 | // for more guidance on F# programming. 3 | 4 | #load "Messages.fs" 5 | #load "Pipes.fs" 6 | #load "Filters.fs" 7 | #load "Runners.fs" 8 | 9 | open System 10 | open FSharp.DataProcessingPipelines.Core 11 | open FSharp.DataProcessingPipelines.Core.Messages 12 | open FSharp.DataProcessingPipelines.Core.Pipes 13 | open FSharp.DataProcessingPipelines.Core.Filters 14 | open FSharp.DataProcessingPipelines.Core.Runners 15 | 16 | let testMessage = EventInformationMessage("This is a new test Message!", "This is the context of the new Test Message!") 17 | let mutable messages = (testMessage::[]) 18 | messages <- (testMessage::messages) 19 | 20 | // OutputPipe type example 21 | type ServiceAOutputPipe () = 22 | inherit IOutputPipe () 23 | override this.Publish (m) = 24 | messages <- (List.append messages [m]) 25 | 26 | // InputPIpe type example 27 | type ServiceBInputPipe () = 28 | inherit IInputPipe () 29 | override this.Subscribe (handler:(EventInformationMessage -> unit)) = 30 | match messages with 31 | | [] -> printfn "Messages is empty" 32 | | h::t -> 33 | messages <- t 34 | handler h 35 | 36 | let outputPipe = new ServiceAOutputPipe() 37 | let inputPipe = new ServiceBInputPipe() 38 | 39 | type ServiceAFilter (pipe:ServiceAOutputPipe) = 40 | inherit DataSource(pipe) 41 | override this.Execute () = 42 | try 43 | try 44 | let msg = EventInformationMessage("This is a new test Message!", "This is the context of the new Test Message!") 45 | printfn "Publish msg to output pipe at Service A: %A" (msg.ToString()) 46 | this.OutputPipe.Publish msg 47 | finally 48 | // Dispose if needed 49 | () 50 | with 51 | | ex -> 52 | // log exception 53 | () 54 | 55 | type ServiceBFilter (pipe:ServiceBInputPipe) = 56 | inherit DataSink(pipe) 57 | override this.Execute () = 58 | let handler (msg) = printfn "Service B Execute -> %A" (msg) 59 | this.InputPipe.Subscribe (handler) 60 | 61 | let myRunnerA = BaseRunner (ServiceAFilter (outputPipe)) 62 | let myRunnerB = BaseRunner (ServiceBFilter (inputPipe)) 63 | 64 | printfn "%d" (messages.Length) 65 | 66 | myRunnerA.Start () 67 | myRunnerB.Start () 68 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/paket.references: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcio-azevedo/fsharp-data-processing-pipeline/f3e557d8dc3a90465f0c854dcebfb8f7211aa50e/src/FSharp.DataProcessingPipelines.Core/paket.references -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.Core/paket.template: -------------------------------------------------------------------------------- 1 | type project 2 | title 3 | FSharp.DataProcessingPipelines.Core 4 | owners 5 | Márcio Azevedo 6 | authors 7 | Márcio Azevedo 8 | projectUrl 9 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline 10 | iconUrl 11 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline/blob/master/docs/files/img/logo.png 12 | licenseUrl 13 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline/blob/master/LICENSE.txt 14 | requireLicenseAcceptance 15 | false 16 | copyright 17 | Copyright 2015 18 | tags 19 | data processing pipeline pipelines pipes filters etl 20 | summary 21 | Provides an extensible solution for creating Data Processing Pipelines in F#. 22 | description 23 | Provides an extensible solution for creating Data Processing Pipelines in F#. 24 | dependencies 25 | FSharp.Core >= 4.3.1 26 | 27 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace System 2 | open System.Reflection 3 | 4 | [] 5 | [] 6 | [] 7 | [] 8 | [] 9 | do () 10 | 11 | module internal AssemblyVersionInformation = 12 | let [] Version = "0.1.0" 13 | let [] InformationalVersion = "0.1.0" 14 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/FSharp.DataProcessingPipelines.RabbitMQ.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {01BACBB1-AE8D-4203-BAC6-3B713CFACF80} 8 | Library 9 | FSharp.DataProcessingPipelines.RabbitMQ 10 | FSharp.DataProcessingPipelines.RabbitMQ 11 | v4.5 12 | 4.4.0.0 13 | true 14 | FSharp.DataProcessingPipelines.RabbitMQ 15 | 16 | 17 | true 18 | false 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | 3 23 | bin\Debug\FSharp.DataProcessingPipelines.RabbitMQ.XML 24 | false 25 | AnyCPU 26 | 27 | 28 | pdbonly 29 | true 30 | true 31 | bin\Release\ 32 | TRACE 33 | 3 34 | bin\Release\FSharp.DataProcessingPipelines.RabbitMQ.XML 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | True 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 11 54 | 55 | 56 | 57 | 58 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 59 | 60 | 61 | 62 | 63 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 64 | 65 | 66 | 67 | 68 | 75 | 76 | 77 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1} 78 | FSharp.DataProcessingPipelines.Core 79 | 80 | 81 | 82 | 83 | 84 | 85 | ..\..\packages\EasyNetQ\lib\net45\EasyNetQ.dll 86 | True 87 | True 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | ..\..\packages\RabbitMQ.Client\lib\netcore45\RabbitMQ.Client.dll 97 | True 98 | True 99 | 100 | 101 | 102 | 103 | 104 | 105 | ..\..\packages\RabbitMQ.Client\lib\net45\RabbitMQ.Client.dll 106 | True 107 | True 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/RabbitMQModule.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.Infrastructure 2 | 3 | open System 4 | open System.Globalization 5 | open System.Threading 6 | open EasyNetQ 7 | open FSharp.DataProcessingPipelines.Core 8 | open FSharp.DataProcessingPipelines.Core.Pipes 9 | 10 | module RabbitMQ = 11 | 12 | /// OutputPipe type implementation for RabbitMQ 13 | type RabbitMQOutputPipe<'T when 'T : not struct> (serviceBus:IBus, topic:String) = 14 | 15 | inherit IOutputPipe<'T> () 16 | 17 | let Bus = serviceBus 18 | let Topic = topic 19 | 20 | override this.Publish m = 21 | try 22 | Bus.Publish<'T>(m, Topic) 23 | with 24 | | ex -> 25 | // log exception 26 | reraise() 27 | 28 | /// InputPipe type implementation for RabbitMQ 29 | type RabbitMQInputPipe<'T when 'T : not struct> 30 | (serviceBus:IBus, subscriberId:String, topic:String, locale:String) = 31 | 32 | inherit IInputPipe<'T> () 33 | 34 | let Bus = serviceBus 35 | let SubscriberId = subscriberId 36 | let Topic = topic 37 | let Locale = locale 38 | 39 | override this.Subscribe (handler:('T -> unit)) = 40 | let InternalHandler (message:'T) = 41 | Thread.CurrentThread.CurrentCulture <- new CultureInfo(Locale) 42 | handler message 43 | try 44 | Bus.Subscribe<'T>(SubscriberId, (fun m -> InternalHandler m), (fun x -> x.WithTopic(Topic) |> ignore)) |> ignore 45 | with 46 | | ex -> 47 | // log exception 48 | reraise() 49 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/Script.fsx: -------------------------------------------------------------------------------- 1 | // Learn more about F# at http://fsharp.org. See the 'F# Tutorial' project 2 | // for more guidance on F# programming. 3 | 4 | #r @"../../packages/RabbitMQ.Client/lib/net45/RabbitMQ.Client.dll" 5 | #r @"../../packages/EasyNetQ/lib/net45/EasyNetQ.dll" 6 | #r @"bin/Debug/FSharp.DataProcessingPipelines.Core.dll" 7 | #load "RabbitMQModule.fs" 8 | 9 | //@"C:\cfn\Celfinet.Spikes\Hands-on-Lab\3-ServiceBusArchitecture\src\Cfn.HOL.ServiceBusArchitecture.Exercise4.Final\FSharp.Test\" 10 | //#r @"bin/Debug/Cfn.Engine.Pipeline.Extensibility.dll" 11 | //#r @"bin/Debug/Cfn.Engine.ServiceBus.RabbitMQ.dll" 12 | //#r @"C:/cfn/Celfinet.Spikes/Hands-on-Lab/3-ServiceBusArchitecture/src/Cfn.HOL.ServiceBusArchitecture.Exercise4.Final/Cfn.HOL.ServiceBusArchitecture.Pipeline/bin/Debug/Cfn.HOL.ServiceBusArchitecture.Pipeline.dll" 13 | //#r @"C:/cfn/Celfinet.Spikes/Hands-on-Lab/3-ServiceBusArchitecture/src/Cfn.HOL.ServiceBusArchitecture.Exercise4.Final/Cfn.HOL.ServiceBusArchitecture.Filters/bin/Debug/Cfn.HOL.ServiceBusArchitecture.Filters.dll" 14 | //#r @"C:\cfn\Celfinet.Spikes\Hands-on-Lab\3-ServiceBusArchitecture\src\Cfn.HOL.ServiceBusArchitecture.Exercise4.Final\Cfn.HOL.Configuration\bin\Debug\Cfn.HOL.ConfigurationGateway.dll" 15 | 16 | //namespace Cfn.HOL.ServiceBusArchitecture.Pipeline.Messages 17 | 18 | open System 19 | open System.Collections.Generic 20 | open System.Globalization 21 | open System.Threading 22 | open RabbitMQ.Client 23 | open EasyNetQ 24 | open FSharp.DataProcessingPipelines.Core 25 | open FSharp.DataProcessingPipelines.Core.Messages 26 | open FSharp.DataProcessingPipelines.Core.Pipes 27 | open FSharp.DataProcessingPipelines.Core.Filters 28 | open FSharp.DataProcessingPipelines.Core.Runners 29 | open FSharp.DataProcessingPipelines.Infrastructure.RabbitMQ 30 | 31 | // See ObservableCollection -> http://www.fssnip.net/dv 32 | type BaseMessage (id:int, events:(DateTime * String) list) = 33 | member this.Id = id 34 | member this.Events = events 35 | 36 | type ServiceBInputPipe 37 | (serviceBus:IBus, subscriberId:String, topic:String, locale:String) = 38 | inherit RabbitMQInputPipe (serviceBus, subscriberId, topic, locale) 39 | 40 | type ServiceAOutputPipe 41 | (serviceBus:IBus, topic:String) = 42 | inherit RabbitMQOutputPipe (serviceBus, topic) 43 | 44 | type ServiceAFilter (pipe:ServiceAOutputPipe) = 45 | inherit DataSource(pipe) 46 | override this.Execute () = 47 | try 48 | try 49 | let msg = BaseMessage(1, [(DateTime.Now, "Test Message created in F# by the ServiceAFilter!")]) 50 | printfn "--- Service A Publishes Msg ---" 51 | this.OutputPipe.Publish msg 52 | finally 53 | // Dispose if needed 54 | () 55 | with 56 | | ex -> 57 | // log exception 58 | () 59 | 60 | type ServiceBFilter (pipe:ServiceBInputPipe) = 61 | inherit DataSink(pipe) 62 | override this.Execute () = 63 | let handler (msg:BaseMessage) = 64 | printfn "--- Service B Execute -> %d: " (msg.Id) 65 | for i in msg.Events do 66 | printfn "(%A, %s)" (fst i) (snd i) 67 | printfn "-----------------------------------------" 68 | this.InputPipe.Subscribe (handler) 69 | 70 | let ServiceBusHost = "host=localhost" //TODO: set an existing RabbitMQ host! 71 | let Culture = "en-US" 72 | 73 | let ServiceASubscriberId = "ServiceASubscriberId" 74 | let ServiceAInputPipeTopic = "ServiceAInputPipeTopic" 75 | let ServiceAOutputPipeTopic = "ServiceAOutputPipeTopic" 76 | 77 | let ServiceBSubscriberId = "ServiceBSubscriberId"; 78 | let ServiceBInputPipeTopic = "ServiceAOutputPipeTopic" 79 | let ServiceBOutputPipeTopic = "ServiceDInputPipeTopic" 80 | 81 | let serviceBus = 82 | try 83 | RabbitHutch.CreateBus(ServiceBusHost) 84 | with 85 | | ex -> 86 | let innerException = ex.InnerException 87 | printfn "%A %A" (ex.Message) (innerException) 88 | raise ex 89 | 90 | let outputPipe = new ServiceAOutputPipe(serviceBus, ServiceAInputPipeTopic) 91 | let inputPipe = new ServiceBInputPipe(serviceBus, ServiceBSubscriberId, ServiceAInputPipeTopic, Culture) 92 | 93 | let myRunnerA = BaseRunner (ServiceAFilter (outputPipe)) 94 | let myRunnerB = BaseRunner (ServiceBFilter (inputPipe)) 95 | 96 | myRunnerA.Start () 97 | myRunnerB.Start () 98 | -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/paket.references: -------------------------------------------------------------------------------- 1 | RabbitMQ.Client 2 | EasyNetQ -------------------------------------------------------------------------------- /src/FSharp.DataProcessingPipelines.RabbitMQ/paket.template: -------------------------------------------------------------------------------- 1 | type project 2 | title 3 | FSharp.DataProcessingPipelines.RabbitMQ 4 | owners 5 | Márcio Azevedo 6 | authors 7 | Márcio Azevedo 8 | projectUrl 9 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline 10 | iconUrl 11 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline/blob/master/docs/files/img/logo.png 12 | licenseUrl 13 | https://github.com/marcio-azevedo/fsharp-data-processing-pipeline/blob/master/LICENSE.txt 14 | requireLicenseAcceptance 15 | false 16 | copyright 17 | Copyright 2015 18 | tags 19 | data processing pipeline pipelines pipes filters etl rabbitmq easynetq bus queue fsharp f# 20 | summary 21 | Provides an extensible solution for creating Data Processing Pipelines in F#. 22 | description 23 | Provides an extensible solution for creating Data Processing Pipelines in F#. 24 | dependencies 25 | FSharp.Core >= 4.3.1 26 | FSharp.DataProcessingPipelines.Core 27 | RabbitMQ.Client >= 3.6.1 28 | EasyNetQ >= 0.57.2 29 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace FSharp.DataProcessingPipelines.RabbitMQ.Tests.AssemblyInfo 2 | 3 | open System.Reflection 4 | open System.Runtime.CompilerServices 5 | open System.Runtime.InteropServices 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [] 11 | [] 12 | [] 13 | [] 14 | [] 15 | [] 16 | [] 17 | [] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [] 23 | 24 | // The following GUID is for the ID of the typelib if this project is exposed to COM 25 | [] 26 | 27 | // Version information for an assembly consists of the following four values: 28 | // 29 | // Major Version 30 | // Minor Version 31 | // Build Number 32 | // Revision 33 | // 34 | // You can specify all the values or you can default the Build and Revision Numbers 35 | // by using the '*' as shown below: 36 | // [] 37 | [] 38 | [] 39 | 40 | do 41 | () -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 2.0 8 | 4e63c011-32f8-48fe-a0fa-aea0af27f9b2 9 | Exe 10 | FSharp.DataProcessingPipelines.RabbitMQ.Tests 11 | FSharp.DataProcessingPipelines.RabbitMQ.Tests 12 | v4.5 13 | true 14 | 4.4.0.0 15 | FSharp.DataProcessingPipelines.RabbitMQ.Tests 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | 3 26 | AnyCPU 27 | bin\Debug\FSharp.DataProcessingPipelines.RabbitMQ.Tests.XML 28 | true 29 | 30 | 31 | pdbonly 32 | true 33 | true 34 | bin\Release\ 35 | TRACE 36 | 3 37 | AnyCPU 38 | bin\Release\FSharp.DataProcessingPipelines.RabbitMQ.Tests.XML 39 | true 40 | 41 | 42 | 43 | 44 | True 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | FSharp.DataProcessingPipelines.Core 57 | {dd56d434-1724-4bd4-ac8f-9a8e705eb7c1} 58 | True 59 | 60 | 61 | FSharp.DataProcessingPipelines.RabbitMQ 62 | {01bacbb1-ae8d-4203-bac6-3b713cfacf80} 63 | True 64 | 65 | 66 | 67 | 11 68 | 69 | 70 | 71 | 72 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 73 | 74 | 75 | 76 | 77 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 78 | 79 | 80 | 81 | 82 | 89 | 90 | 91 | 92 | 93 | ..\..\packages\EasyNetQ\lib\net45\EasyNetQ.dll 94 | True 95 | True 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | ..\..\packages\RabbitMQ.Client\lib\netcore45\RabbitMQ.Client.dll 105 | True 106 | True 107 | 108 | 109 | 110 | 111 | 112 | 113 | ..\..\packages\RabbitMQ.Client\lib\net45\RabbitMQ.Client.dll 114 | True 115 | True 116 | 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests/Program.fs: -------------------------------------------------------------------------------- 1 | // Learn more about F# at http://fsharp.org 2 | // See the 'F# Tutorial' project for more help. 3 | 4 | open System 5 | open EasyNetQ 6 | open FSharp.DataProcessingPipelines.Core 7 | open FSharp.DataProcessingPipelines.Core.Messages 8 | open FSharp.DataProcessingPipelines.Core.Pipes 9 | open FSharp.DataProcessingPipelines.Core.Filters 10 | open FSharp.DataProcessingPipelines.Core.Runners 11 | open FSharp.DataProcessingPipelines.Infrastructure.RabbitMQ 12 | 13 | type BaseMessage (id:int, events:(DateTime * String) list) = 14 | member this.Id = id 15 | member this.Events = events 16 | 17 | type ServiceBInputPipe 18 | (serviceBus:IBus, subscriberId:String, topic:String, locale:String) = 19 | inherit RabbitMQInputPipe (serviceBus, subscriberId, topic, locale) 20 | 21 | type ServiceAOutputPipe 22 | (serviceBus:IBus, topic:String) = 23 | inherit RabbitMQOutputPipe (serviceBus, topic) 24 | 25 | type ServiceAFilter (pipe:ServiceAOutputPipe) = 26 | inherit DataSource(pipe) 27 | override this.Execute () = 28 | try 29 | try 30 | let msg = BaseMessage(1, [(DateTime.Now, "Test Message created in F# by the ServiceAFilter!")]) 31 | this.OutputPipe.Publish msg 32 | finally 33 | // Dispose if needed 34 | () 35 | with 36 | | ex -> 37 | // log exception 38 | () 39 | 40 | type ServiceBFilter (pipe:ServiceBInputPipe) = 41 | inherit DataSink(pipe) 42 | override this.Execute () = 43 | let handler (msg:BaseMessage) = 44 | printfn "--- Service B Execute -> %d: " (msg.Id) 45 | for i in msg.Events do 46 | printfn "(%A, %s)" (fst i) (snd i) 47 | printfn "-----------------------------------------" 48 | this.InputPipe.Subscribe (handler) 49 | 50 | let ServiceBusHost = "host=localhost" //TODO: set an existing RabbitMQ host! 51 | let Culture = "en-US" 52 | 53 | let ServiceASubscriberId = "ServiceASubscriberId" 54 | let ServiceAInputPipeTopic = "ServiceAInputPipeTopic" 55 | let ServiceAOutputPipeTopic = "ServiceAOutputPipeTopic" 56 | 57 | let ServiceBSubscriberId = "ServiceBSubscriberId"; 58 | let ServiceBInputPipeTopic = "ServiceAOutputPipeTopic" 59 | let ServiceBOutputPipeTopic = "ServiceDInputPipeTopic" 60 | 61 | let serviceBus = 62 | try 63 | RabbitHutch.CreateBus(ServiceBusHost) 64 | with 65 | | ex -> 66 | let innerException = ex.InnerException 67 | printfn "%A %A" (ex.Message) (innerException) 68 | reraise() 69 | 70 | //for i in 1..10 do 71 | // let message = new BaseMessage(i,[(DateTime.Now, "Exercise Test Started!")]) 72 | // serviceBus.Publish(message, ServiceAInputPipeTopic) 73 | 74 | let outputPipe = new ServiceAOutputPipe(serviceBus, ServiceAInputPipeTopic) 75 | let inputPipe = new ServiceBInputPipe(serviceBus, ServiceBSubscriberId, ServiceAInputPipeTopic, Culture) 76 | 77 | let myRunnerA = BaseRunner (ServiceAFilter (outputPipe)) 78 | let myRunnerB = BaseRunner (ServiceBFilter (inputPipe)) 79 | 80 | 81 | [] 82 | let main argv = 83 | printfn "%A" argv 84 | try 85 | myRunnerB.Start () 86 | myRunnerA.Start () 87 | printfn "myRunnerA.Start () -> Message sent to Queue!" 88 | with 89 | | ex -> 90 | let innerException = ex.InnerException 91 | printfn "%A %A" (ex.Message) (innerException) 92 | reraise() 93 | 0 // return an integer exit code 94 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.RabbitMQ.Tests/paket.references: -------------------------------------------------------------------------------- 1 | RabbitMQ.Client 2 | EasyNetQ -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.Tests/FSharp.DataProcessingPipelines.Tests.fsproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {DC84595B-22D2-463C-BCD1-E7476CB80F8C} 8 | Library 9 | FSharp.DataProcessingPipelines.Tests 10 | FSharp.DataProcessingPipelines.Tests 11 | v4.5 12 | 4.3.0.0 13 | FSharp.DataProcessingPipelines.Tests 14 | 15 | ..\..\ 16 | 17 | 18 | true 19 | false 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | 3 24 | Project 25 | 26 | 27 | 28 | 29 | 30 | 31 | pdbonly 32 | true 33 | true 34 | bin\Release\ 35 | TRACE 36 | 3 37 | true 38 | 39 | 40 | 11 41 | 42 | 43 | 44 | 45 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 46 | 47 | 48 | 49 | 50 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | True 68 | 69 | 70 | 77 | 78 | 79 | 80 | FSharp.DataProcessingPipelines.Core 81 | {DD56D434-1724-4BD4-AC8F-9A8E705EB7C1} 82 | 83 | 84 | 85 | 86 | ..\..\packages\test\NUnit\lib\nunit.framework.dll 87 | True 88 | 89 | 90 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.Tests/Tests.fs: -------------------------------------------------------------------------------- 1 | module FSharp.DataProcessingPipelines.Tests 2 | 3 | open System 4 | open NUnit.Framework 5 | open FSharp.DataProcessingPipelines.Core 6 | open FSharp.DataProcessingPipelines.Core.Messages 7 | open FSharp.DataProcessingPipelines.Core.Pipes 8 | open FSharp.DataProcessingPipelines.Core.Filters 9 | open FSharp.DataProcessingPipelines.Core.Runners 10 | 11 | // Types and vals to supoprt unit testing 12 | 13 | let mutable messages = ([]:EventInformationMessage list) 14 | 15 | // OutputPipe type example 16 | type ServiceAOutputPipe () = 17 | inherit IOutputPipe () 18 | override this.Publish (m) = 19 | messages <- (List.append messages [m]) 20 | 21 | // InputPIpe type example 22 | type ServiceBInputPipe () = 23 | inherit IInputPipe () 24 | override this.Subscribe (handler:(EventInformationMessage -> unit)) = 25 | match messages with 26 | | [] -> printfn "Messages is empty" 27 | | h::t -> 28 | messages <- t 29 | handler h 30 | 31 | type ServiceAFilter (pipe:ServiceAOutputPipe) = 32 | inherit DataSource(pipe) 33 | override this.Execute () = 34 | try 35 | try 36 | let msg = EventInformationMessage("This is a new test Message!", "This is the context of the new Test Message!") 37 | printfn "Publish msg to output pipe at Service A: %A" (msg.ToString()) 38 | this.OutputPipe.Publish msg 39 | finally 40 | // Dispose if needed 41 | () 42 | with 43 | | ex -> 44 | // log exception 45 | () 46 | 47 | type ServiceBFilter (pipe:ServiceBInputPipe) = 48 | inherit DataSink(pipe) 49 | override this.Execute () = 50 | let handler (msg) = printfn "Service B Execute -> %A" (msg) 51 | this.InputPipe.Subscribe (handler) 52 | 53 | /// Tests 54 | 55 | let outputPipe = new ServiceAOutputPipe() 56 | let inputPipe = new ServiceBInputPipe() 57 | 58 | let myRunnerA = BaseRunner (ServiceAFilter (outputPipe)) 59 | let myRunnerB = BaseRunner (ServiceBFilter (inputPipe)) 60 | 61 | let testMessage = EventInformationMessage("This is a new test Message!", "This is the context of the new Test Message!") 62 | 63 | [] 64 | let ``Service B consumes 2 messages`` () = 65 | messages <- (testMessage::[]) 66 | messages <- (testMessage::messages) 67 | myRunnerB.Start () 68 | myRunnerB.Start () 69 | let result = messages.Length 70 | printfn "%i" (result) 71 | Assert.AreEqual(0,result) 72 | 73 | [] 74 | let ``Service A publishes 2 messages`` () = 75 | myRunnerA.Start () 76 | myRunnerA.Start () 77 | let result = messages.Length 78 | printfn "%i" (result) 79 | Assert.AreEqual(2,result) 80 | 81 | 82 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.Tests/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/FSharp.DataProcessingPipelines.Tests/paket.references: -------------------------------------------------------------------------------- 1 | group Test 2 | NUnit 3 | NUnit.Runners --------------------------------------------------------------------------------