Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
update example
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Jul 30, 2022
1 parent cd079e0 commit 374465d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ Tiny and fast pubsub implementation with subscriber priorities and event canceli
###### usage

```java
void run(){
Bus bus=new Bus();
bus.reg(Sub.of(System.out::println));
void run() {
Bus bus = new Bus();
bus.reg(Sub.of(String.class, System.out::println));
bus.pub("Hello World!");
}
}
```

```java
class Listenable {
Sub<Long> sub = Sub.of(l -> ThreadLocalRandom.current().setSeed(l));

Sub<Long> sub = Sub.of(Long.class, l -> Foo.bar(l));
void run() {
Bus bus = new Bus();
bus.reg(this);
Expand Down

0 comments on commit 374465d

Please sign in to comment.