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 cc26351
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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 cc26351

Please sign in to comment.