I hereby claim:
- I am autodidaddict on github.
- I am autodidaddict (https://keybase.io/autodidaddict) on keybase.
- I have a public key ASAutaH5uQpgRtlgvounqqJWTywNRFZfzks7qfWBLwZX7go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
use std::thread::spawn; | |
use std::sync::Arc; | |
use std::sync::Mutex; | |
use std::sync::mpsc; | |
#[derive(Debug)] | |
struct Transaction { | |
amount: isize, | |
timestamp: u64, | |
txid: String, |
fn get_library_entries( | |
&self, | |
ctx: RpcContext, | |
req: LibraryEntriesRequest, | |
resp: ServerStreamingSink<LibraryEntry>, | |
) { | |
info!( | |
"Handling get library entries request: {}", | |
req.get_agent_id() | |
); |
import ballerina/grpc; | |
endpoint grpc:Listener listener { | |
host: "localhost", | |
port: 9090 | |
}; | |
map <droneInfo> dronesMap; | |
type droneInfo record { |
import ballerina/grpc; | |
import ballerina/log; | |
endpoint grpc:Listener listener { | |
host: "localhost", | |
port: 9090, | |
}; | |
map <DroneInfo> dronesMap; | |
type DroneInfo record { | |
string id; | |
string name; |
@grpc:ServiceConfig | |
service DroneMgmt bind listener { | |
GetDrone(endpoint caller, string droneId) { | |
DroneInfo info = dronesMap[droneId] but { ()=>{} }; | |
_ = caller->send(info); | |
_ = caller->complete(); | |
} | |
AddDrone(endpoint caller, DroneInfo droneReq) { | |
string droneId = droneReq.id; | |
dronesMap[droneId] = droneReq; |
syntax = "proto3"; | |
import "google/protobuf/wrappers.proto"; | |
service DroneMgmt { | |
rpc GetDrone(google.protobuf.StringValue) returns (DroneInfo); | |
rpc AddDrone(DroneInfo) returns (DroneInfo); | |
rpc UpdateDrone(DroneInfo) returns (DroneInfo); | |
} | |
message DroneInfo { | |
string id = 1; | |
string name = 2; |
import ballerina/io; | |
import ballerina/log; | |
import ballerina/grpc; | |
function main(string... args) { | |
endpoint DroneMgmtBlockingClient droneMgmtBlockingEp { | |
url: "http://localhost:9090" | |
}; | |
DroneInfo req = {battery_remaining: 12, id: "DRONE1", | |
name: "Drone One"}; | |
import ballerina/grpc; | |
import ballerina/log; | |
import ballerinax/docker; | |
@docker:Expose {} | |
endpoint grpc:Listener listener { | |
host: "localhost", | |
port: 9090 | |
}; |
import ballerina/io; | |
function main(string... args) { | |
stream<string> userInput; | |
fork { | |
worker stdin_read { | |
while(true) { | |
io:println("Type something:"); |