Skip to content

Commit b024c6f

Browse files
author
giordanol
committed
remove static variables to enable multiple instances on same process
1 parent b24c01f commit b024c6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Blumchen/Subscriptions/Subscription.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public enum CreateStyle
2525
AlwaysRecreate,
2626
Never
2727
}
28-
private static LogicalReplicationConnection? _connection;
29-
private static readonly SubscriptionOptionsBuilder Builder = new();
28+
private LogicalReplicationConnection? _connection;
29+
private readonly SubscriptionOptionsBuilder _builder = new();
3030
private ISubscriptionOptions? _options;
3131
public async IAsyncEnumerable<IEnvelope> Subscribe(
3232
Func<SubscriptionOptionsBuilder, SubscriptionOptionsBuilder> builder,
3333
ILoggerFactory? loggerFactory = null,
3434
[EnumeratorCancellation] CancellationToken ct = default
3535
)
3636
{
37-
_options = builder(Builder).Build();
37+
_options = builder(_builder).Build();
3838
var (connectionString, publicationSetupOptions, replicationSlotSetupOptions, errorProcessor, replicationDataMapper, registry) = _options;
3939
var dataSourceBuilder = new NpgsqlDataSourceBuilder(connectionString);
4040
dataSourceBuilder.UseLoggerFactory(loggerFactory);

0 commit comments

Comments
 (0)