Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
drosowski committed Nov 6, 2023
1 parent 0ccb063 commit 84185e2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ socket.io-servers and three consuming socket.io-clients.

### Usage in Spring Boot and Jedis

Jedis:
We don't want to rely on the Spring Data Redis abstractions in this project.
Unfortunately, this makes it necessary that you configure the `JedisPool` manually in your Spring Boot application.
Having JedisPool configured, the emitter can be created as follows:

```kotlin
@Bean
fun emitter(redisConnectionFactory: RedisConnectionFactory): Emitter {
val jedisConnectionFactory = redisConnectionFactory as JedisConnectionFactory
val jedisConnection = jedisConnectionFactory.connection as JedisConnection
return Emitter(JedisPublisher(jedisConnection.jedis))
fun emitter(jedisPool: JedisPool): Emitter {
return Emitter(JedisPublisher(jedisPool))
}
```

Expand Down

0 comments on commit 84185e2

Please sign in to comment.