-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event bus streaming mockup #4710
Draft
vietj
wants to merge
12
commits into
master
Choose a base branch
from
event-bus-streaming-mockup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7c91ee4
Protocol in plantuml
vietj 3c3753e
Decouple from outbound delivery context
vietj 19c96f0
Decouple HandlerRegistration from HandlerHolder
vietj 272a328
Some
vietj 9980a85
Remove DeliveryOptions wherever possible
vietj 20746ba
Node selector should care about addresses instead of messages
vietj b51073a
Remove reply handler flag from HandlerHolder
vietj ca06d21
Use a broadcast flag when registering a handler registration
vietj d044fb1
Try to introduce Frame for what we exchange between peers
vietj 82f2e24
Handler registration should process generic frames
vietj 761f252
Basic stream implementation
vietj 42bc778
Update eventbus markdown
vietj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) 2011-2021 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
*/ | ||
package io.vertx.core.eventbus; | ||
|
||
import io.vertx.codegen.annotations.VertxGen; | ||
import io.vertx.core.Handler; | ||
|
||
@VertxGen | ||
public interface MessageStream { | ||
|
||
void handler(Handler<Message<String>> handler); | ||
|
||
void endHandler(Handler<Void> handler); | ||
|
||
void write(String msg); | ||
|
||
void end(); | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/io/vertx/core/eventbus/impl/ClientStream.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.vertx.core.eventbus.impl; | ||
|
||
import io.vertx.core.Promise; | ||
import io.vertx.core.eventbus.MessageStream; | ||
import io.vertx.core.impl.ContextInternal; | ||
|
||
class ClientStream extends StreamBase { | ||
|
||
private final Promise<MessageStream> promise2; | ||
|
||
public ClientStream(EventBusImpl eventBus, String sourceAddress, ContextInternal ctx, Promise<MessageStream> promise2) { | ||
super(sourceAddress, ctx, eventBus, sourceAddress, true); | ||
this.promise2 = promise2; | ||
} | ||
|
||
@Override | ||
protected boolean doReceive(Frame frame) { | ||
if (frame instanceof SynFrame) { | ||
SynFrame syn = (SynFrame) frame; | ||
remoteAddress = syn.src; | ||
promise2.complete(this); | ||
return true; | ||
} else { | ||
return super.doReceive(frame); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.vertx.core.eventbus.impl; | ||
|
||
import io.vertx.core.buffer.Buffer; | ||
|
||
class FinFrame implements Frame { | ||
|
||
final String addr; | ||
|
||
public FinFrame(String addr) { | ||
this.addr = addr; | ||
} | ||
|
||
@Override | ||
public String address() { | ||
return addr; | ||
} | ||
|
||
@Override | ||
public Buffer encodeToWire() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public boolean isFromWire() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2011-2023 Contributors to the Eclipse Foundation | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
* which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
*/ | ||
package io.vertx.core.eventbus.impl; | ||
|
||
import io.vertx.core.buffer.Buffer; | ||
|
||
public interface Frame { | ||
|
||
String address(); | ||
|
||
Buffer encodeToWire(); | ||
|
||
boolean isFromWire(); | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an Enum
FrameSource
?