vertx-eventbus-bridge-clients
vertx-eventbus-bridge-clients copied to clipboard
Outreachy: WebRTC+sockjs eventbus client
WebRTC eventbus extension to sockjs.
Vert.x already has some simple javascript library to handle all the sockjs event bus. You should attempt to understand the code living here:
https://github.com/vert-x3/vertx-eventbus-bridge-clients/blob/master/javascript/vertx-eventbus.js
- The first action to complete is to attempt to understand the gist of this script.
- Try to understand how the event bus works
- understand the 1-1 message flow
- understand the 1-N message flow (publish)
- understand the 1-1 message reply
- understand the N-1 message (publish reply)
Tasks
Get to know the code by refactoring
As you can see, this code is quite old and not using much of the features JavaScript offers today.
As a code exercise, you should start by refactoring the script to use:
- ES6
class
to model theEventBus
object https://tc39.es/ecma262/#sec-class-definitions - ES6
Promise
to signal asynchronous return types instead of callbacks https://tc39.es/ecma262/#sec-promise-objects
This would make you comfortable with the code.
Research the state of the art
A small research on state of the art is the follow-up task. This task is about learning WebRTC. Read the links:
- https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
- https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Simple_RTCDataChannel_sample
Try to run the examples and see if you understand what is happening.
Research if there are already some project implementing this?
The third step is to use your favorite search engine and look up for projects already implementing the goals of this project.
You will probably find the following github repository:
- https://github.com/tommytee/vertx3-eventbus-client-webrtc
If you pick it up from there you will notice that in a way the project is already there. But there's a catch. The code doesn't work with today's vert.x version.
Nevertheless, you will notice that the javascript script is highly based on our original code.
Start by drafting what are the differences and how we can port those to our script.
Backend coding
If you are working based on the knowledge from the previous example, you'll see that you will need some backend code too. Try to understand the code:
https://github.com/tommytee/vertx3-eventbus-webrtc-helper
Once you get the idea it means you will need to create a pull request to: https://github.com/vert-x3/vertx-web but this new handler should be written in java.
Investigate what is missing
The example is old, so it may mean that it doesn't implement signaling. Which means you may need to define a simple signaling support, however, remember that signaling can be easily done with the existing event bus support.
Close the open bits
Write a simple demo application where we can see this working.
Hello, @pmlopes this looks interesting. I would love to be part of this conversation.
@mencian with my last two commits now the issue with OpenSSL is resolved, but now it needs https://anaconda.org/conda-forge/tensorflow-estimator for Linux ARM64.
Update: The latest version of tensorflow-estimator
is noarch
but Medaka depends on tensorflow >=2.10,<2.11
this is the reason why it fails for tensorflow-estimator 2.10.*
.
But https://anaconda.org/search?q=tensorflow shows that latest conda-forrge/tensorflow does not support linux-aarch64
, while anaconda/tensorflow
does provide a package for linux-aarch64.
https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/5c1bda34072ebc74cf72d588a8999649d4322ee9/recipe/migrations/arch_rebuild.txt#L970-L971 says that someone requested support for Linux aarch64 but according to https://conda-forge.org/status/migration/aarch64andppc64leaddition it depends on https://github.com/conda-forge/dgl-feedstock/pull/14
I will start working on refactoring the code and test it with the java server.
@pmlopes, I have also gone through the script. I have a question though, are we to open one or more pull requests concerning refactoring?
Hello @pmlopes . Am sharif and will be glad contributing to this project. am intrested in this issue , anyone working on it.