File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,4 +100,22 @@ object PostgresNotifyFlowable {
100100 return retryingObservable.share()
101101 }
102102
103+ /* *
104+ * A variant of [forChannels] with defaults set, to make usage from Java more ergonomic
105+ */
106+ fun forChannels (
107+ jdbcUrl : String ,
108+ user : String ,
109+ password : String ,
110+ channels : List <String >
111+ ): Flowable <PGNotification > = forChannels(
112+ jdbcUrl = jdbcUrl,
113+ user = user,
114+ password = password,
115+ pollingPeriodMs = 1000 ,
116+ reconnectionTimeoutMs = 5000 ,
117+ channels = channels,
118+ backpressureStrategy = BUFFER
119+ )
120+
103121}
Original file line number Diff line number Diff line change 11import ch.sponty.backend.common.database.postgres.PostgresNotifyFlowable
2+ import io.reactivex.BackpressureStrategy
23import io.reactivex.schedulers.Schedulers
34import org.junit.jupiter.api.Test
45import org.postgresql.jdbc.PgConnection
@@ -28,7 +29,7 @@ class PostgresFlowableTest {
2829 password = db.password,
2930 pollingPeriodMs = 1000 ,
3031 channels = listOf (" test" ),
31- backpressureStrategy = BUFFER
32+ backpressureStrategy = BackpressureStrategy . BUFFER
3233 )
3334
3435 val latch = CountDownLatch (4 )
You can’t perform that action at this time.
0 commit comments