Skip to content

Instantly share code, notes, and snippets.

@unludo
unludo / machine.js
Created November 16, 2020 10:34
Generated by XState Viz: https://xstate.js.org/viz
const fuMachine = Machine(
{
id: 'promise',
initial: 'connecting',
context: {
sstEndpointClient: null,
sstEndpointInstanceInfo: null,
fuStream: null,
},
states: {
@unludo
unludo / gatlingGrpcBidirStreamGist.scala
Created February 26, 2020 15:39
bidir stream example for gatling-grpc - below 0.8 version
def connect(productIdFieldName: String, token: String, checkLicenseUpdate:Boolean = false): GrpcCallActionBuilder[ProductConnectionReq, ProductStrmgMessage] = {
val dT = Calendar.getInstance()
grpc("connectReq")
.service(ProductServiceGrpc.stub)
.rpc(service => { req: ProductConnectionReq =>
val p = Promise[ProductStrmgMessage]()
val requestObserver = service.connect(
new ClientResponseObserver[ProductConnectionReq, ProductStrmgMessage] {