Skip to content

Commit 464bfba

Browse files
committed
Generic filter
1 parent 42ab64e commit 464bfba

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Propulsion/Propulsion.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<TargetFramework>net6.0</TargetFramework>
77
<!-- NOTE FSharp.Core dep is implies by what `FSharp.Control.TaskSeq` dictates; see below -->
88
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
9-
<PackageValidationBaselineVersion>3.0.0-rc.14.3</PackageValidationBaselineVersion>
9+
<!-- <PackageValidationBaselineVersion>3.0.0-rc.14.3</PackageValidationBaselineVersion>-->
1010
</PropertyGroup>
1111

1212
<ItemGroup>

src/Propulsion/StreamFilter.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ namespace Propulsion
33
open Propulsion.Internal
44
open System.Runtime.InteropServices
55

6-
type StreamFilter([<Optional>] allowCats, [<Optional>] denyCats, [<Optional>] allowSns, [<Optional>] denySns,
6+
type StreamFilter<'EventBody>(
7+
[<Optional>] allowCats, [<Optional>] denyCats, [<Optional>] allowSns, [<Optional>] denySns,
78
[<Optional>] allowEts, [<Optional>] denyEts,
89
[<Optional; DefaultParameterValue(false)>] ?includeSystem,
910
[<Optional; DefaultParameterValue(null)>] ?log) =
@@ -36,11 +37,11 @@ type StreamFilter([<Optional>] allowCats, [<Optional>] denyCats, [<Optional>] al
3637
let denyCats = if includeSystem_ then denyCats else Array.append denyCats [| "^\$" |]
3738
let allowSns, denySns = match allowSns, denySns with [||], [||] -> [|".*"|], [||] | x -> x
3839
let allowEts, denyEts = match allowEts, denyEts with [||], [||] -> [|".*"|], [||] | x -> x
39-
log.Value.Information("Categories ☑️ {@allowCats} 🚫{@denyCats} Streams ☑️ {@allowStreams} 🚫{denyStreams} Events ☑️ {allowEts} 🚫{@denyEts}",
40+
log.Value.Information("Categories {@allowCats} 🚫{@denyCats} Streams {@allowStreams} 🚫{denyStreams} Events {allowEts} 🚫{@denyEts}",
4041
asRe allowCats, asRe denyCats, asRe allowSns, asRe denySns, asRe allowEts, asRe denyEts)
4142
fun sn ->
4243
validCat sn
4344
&& validStream sn
4445
&& (includeSystem || isTransactionalStream sn)
4546

46-
member val EventFilter = filter (fun (x: Propulsion.Sinks.Event) -> x.EventType) (allowEts, denyEts)
47+
member val EventFilter = filter (fun (x: FsCodec.ITimelineEvent<'EventBody>) -> x.EventType) (allowEts, denyEts)

0 commit comments

Comments
 (0)