Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Allows remote procedure calls between JS objects over event-like channels or the network
jpc allows you to call JS objects in other processes. From your JS objects, it automatically
creates an API that resembles your object API, just with an await
in front of every call.
It then transmits the call over the channel and call the objects in the remote process,
and returns the result back to you.
It can work over various communication channels to communicate with the remote process:
This is what your client calls initially and gets the first object references from.
The remote API is the same as the local API, just with an await
prepended to all calls, aside from new
and setters.
Local object | Remote object | Difference | |
---|---|---|---|
function | car.startEngine() | await car.startEngine() | same, just with await |
getter | car.owner | await car.owner | same, just with await |
setter | car.owner = val | await car.setOwner(val) | because setters always return the assigned value |
new | new Car() | await Car.newRemote() | because new always returns the object |
Given an object of class
class Movable {
constructor() {}
}
class Car extends Movable {
constructor() {
this.super();
this._owner = "Fred Flintstone";
}
startEngine() {
console.log("Engine started");
}
get owner {
return this._owner;
}
set owner(val) {
this._owner = val;
}
}
The local API in the server process is standard JS:
let car = new Car();
car.owner = "Wilma";
console.log(car.owner);
car.startEngine();
The client API in the other process is almost the same, just with an await
added in front of all calls:
let car = await Car.newRemote(); // creates a new object in the server process
await car.setOwner("Wilma");
console.log(await car.owner); // shows "Wilma" on the client
await car.startEngine(); // shows "Engine started" on the server
FAQs
Allows remote procedure calls between JS objects over event-like channels or the network
We found that jpc-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.