Skip to content

Commit

Permalink
EventFilter -> CreateEventFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Sep 6, 2024
1 parent 42ab64e commit d4757fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<!-- suppress false positive warning FS2003 about invalid version of AssemblyInformationalVersionAttribute -->
<!-- supress NU5105 triggered by trailing dotted elements such as .43 and .2 in e.g.: pr.43-rc1.2: The package version '<X>' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients. Change the package version to a SemVer 1.0.0 string. If the version contains a release label it must start with a letter. This message can be ignored if the package is not intended for older clients. -->
<NoWarn>$(NoWarn);FS2003;NU5105</NoWarn>
<PinnedBaseVersion Condition=" '$(Configuration)' == 'Release' ">3.0.0-rc.14.3</PinnedBaseVersion>
<PinnedBaselineRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedBaselineRootPackage>
<PinnedDynamoStoreRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedDynamoStoreRootPackage>
<!-- <PinnedBaseVersion Condition=" '$(Configuration)' == 'Release' ">3.0.0-rc.14.3</PinnedBaseVersion>-->
<!-- <PinnedBaselineRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedBaselineRootPackage>-->
<!-- <PinnedDynamoStoreRootPackage Condition=" '$(Configuration)' == 'Release' ">[$(PinnedBaseVersion), 4.0.0)</PinnedDynamoStoreRootPackage>-->
</PropertyGroup>
<ItemGroup>
<!-- SourceLink etc -->
Expand Down
2 changes: 1 addition & 1 deletion src/Propulsion/Propulsion.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFramework>net6.0</TargetFramework>
<!-- NOTE FSharp.Core dep is implies by what `FSharp.Control.TaskSeq` dictates; see below -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<PackageValidationBaselineVersion>3.0.0-rc.14.3</PackageValidationBaselineVersion>
<!-- <PackageValidationBaselineVersion>3.0.0-rc.14.3</PackageValidationBaselineVersion>-->
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Propulsion/StreamFilter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type StreamFilter([<Optional>] allowCats, [<Optional>] denyCats, [<Optional>] al
let denyCats = if includeSystem_ then denyCats else Array.append denyCats [| "^\$" |]
let allowSns, denySns = match allowSns, denySns with [||], [||] -> [|".*"|], [||] | x -> x
let allowEts, denyEts = match allowEts, denyEts with [||], [||] -> [|".*"|], [||] | x -> x
log.Value.Information("Categories ☑️ {@allowCats} 🚫{@denyCats} Streams ☑️ {@allowStreams} 🚫{denyStreams} Events ☑️ {allowEts} 🚫{@denyEts}",
log.Value.Information("Categories {@allowCats} 🚫{@denyCats} Streams {@allowStreams} 🚫{denyStreams} Events {allowEts} 🚫{@denyEts}",
asRe allowCats, asRe denyCats, asRe allowSns, asRe denySns, asRe allowEts, asRe denyEts)
fun sn ->
validCat sn
&& validStream sn
&& (includeSystem || isTransactionalStream sn)

member val EventFilter = filter (fun (x: Propulsion.Sinks.Event) -> x.EventType) (allowEts, denyEts)
member _.CreateEventFilter<'EventBody>() = filter (fun (x: FsCodec.ITimelineEvent<'EventBody>) -> x.EventType) (allowEts, denyEts)
3 changes: 2 additions & 1 deletion tools/Propulsion.Tool/Sync.fs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ let run appName (c: Args.Configuration, p: ParseResults<Parameters>) = async {
|> Propulsion.Codec.NewtonsoftJson.Serdes.Serialize
do! producer.ProduceAsync(FsCodec.StreamName.toString stream, json) |> Async.Ignore
return Outcome.render_ stream ham spam 0, Propulsion.Sinks.Events.next events }
Propulsion.Sinks.Factory.StartConcurrent(Log.Logger, maxReadAhead, maxConcurrentProcessors, handle a.Filters.EventFilter, stats,
let eventFilter = a.Filters.CreateEventFilter()
Propulsion.Sinks.Factory.StartConcurrent(Log.Logger, maxReadAhead, maxConcurrentProcessors, handle eventFilter, stats,
requireAll = requireAll)
| SubCommand.Sync sa ->
let eventsContext = sa.ConnectEvents() |> Async.RunSynchronously
Expand Down

0 comments on commit d4757fd

Please sign in to comment.