Closed jdonkervliet closed 4 years ago
In GitLab by @julian9499 on Jun 3, 2020, 15:26
Commented on src/main/java/net/glowstone/messaging/channels/ReadWriteChannel.java line 37
I see a lot of repititve code with the locking. Is it not possible to extract this?
In GitLab by @JimVliet on Jun 3, 2020, 15:26
Commented on src/test/java/net/glowstone/messaging/brokers/JmsBrokerTest.java line 48
Perhaps, put the suppress warnings at this single line, instead of the entire method.
In GitLab by @swabbur on Jun 3, 2020, 15:30
Commented on src/main/java/net/glowstone/messaging/channels/ReadWriteChannel.java line 37
The only option would be to extract it to a separate method and to pass the content of the try-block as a lambda.
void locked(Lock lock, Runnable runnable) {
lock.lock();
try {
runnable.run();
} finally {
lock.unlock();
}
}
void publish() {
locked(readLock, () -> {
// ...
});
}
In GitLab by @julian9499 on Jun 3, 2020, 15:30
Commented on src/main/java/net/glowstone/messaging/channels/ReadWriteChannel.java line 37
I would leave it like this for now
In GitLab by @swabbur on Jun 3, 2020, 15:32
added 1 commit
In GitLab by @JimVliet on Jun 3, 2020, 15:49
resolved all threads
In GitLab by @JimVliet on Jun 3, 2020, 15:49
merged
In GitLab by @JimVliet on Jun 3, 2020, 15:49
mentioned in commit bfbc3ccfc3e1982e7bbfa5385291d1a5ad906800
In GitLab by @swabbur on Jun 3, 2020, 13:43
Merges feature/read-write-broker -> development
Resolves issues #74, #75, and #98.
Add a read-write broker and channel and an unsafe channel that can be combined with each other and existing broker/channel implementations.