Skip to content

Commit cb19d84

Browse files
docs: added version differences between v1 and v2
1 parent 8b93e33 commit cb19d84

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@
99
[![issues closed](https://img.shields.io/github/issues-closed/leonsteinhaeuser/observer)](https://img.shields.io/github/issues-closed/leonsteinhaeuser/observer)
1010
[![license](https://img.shields.io/github/license/leonsteinhaeuser/observer)](https://img.shields.io/github/license/leonsteinhaeuser/observer)
1111

12-
1312
This library implements the pub/sub pattern in a generic way. It uses Go's generic types to declare the type of the event.
1413

14+
## Differences between v1 and v2
15+
16+
The v2 release contains breaking changes. The most important ones are:
17+
18+
- The `Observable` interface does not provide a `Clients() int64` method anymore.
19+
- The constructor `NewObserver()` has been removed. Instead, use `new(observer.Observer[T])`.
20+
- The `Observer` has become a `NotifyTimeout` that can be used to set a timeout for the `NotifyAll` method. The default value is `5 * time.Second`.
21+
1522
## Usage
1623

1724
```bash

0 commit comments

Comments
 (0)