This file contains hidden or 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
export class GrpcConnectionFactory { | |
private static autodetect(config: GrpcClientCtor): GrpcConnectionProfile { | |
const isCamundaCloud = config.host.includes('zeebe.camunda.io') | |
return isCamundaCloud ? 'CAMUNDA_CLOUD' : 'VANILLA' | |
} | |
public static getGrpcClient(config: GrpcClientCtor) { | |
const profile = GrpcConnectionFactory.autodetect(config) | |
const grpcClient = new GrpcClient(config) | |
new GrpcMiddleware({ profile, grpcClient }) | |
return new GrpcClient(config) |
This file contains hidden or 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
export class GrpcMiddleware { | |
private static autodetect(config: GrpcClientCtor): GrpcConnectionProfile { | |
const isCamundaCloud = config.host.includes('zeebe.camunda.io') | |
return isCamundaCloud ? 'CAMUNDA_CLOUD' : 'VANILLA' | |
} | |
private characteristics: Characteristics | |
constructor(config: GrpcClientCtor) { | |
const profile = GrpcMiddleware.autodetect(config) | |
this.characteristics = ConnectionCharacteristics[profile] | |
} |
This file contains hidden or 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
type GrpcConnectionProfile = 'CAMUNDA_CLOUD' | 'VANILLA' | |
type Characteristics = any | |
const ConnectionCharacteristics: { | |
[key in GrpcConnectionProfile]: Characteristics | |
} = { | |
CAMUNDA_CLOUD: {}, | |
VANILLA: {}, | |
} |
This file contains hidden or 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
import { GrpcClient, GrpcClientCtor } from './GRPCClient' | |
export class GrpcConnectionFactory { | |
public static getGrpcClient(config: GrpcClientCtor) { | |
return new GrpcClient(config) | |
} | |
} |
This file contains hidden or 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
<iframe | |
src="https://cawemo.com/embed/{{.Get 0}}" | |
style="width:700px;height:500px;border:1px solid #ccc" | |
allowfullscreen | |
></iframe> | |
<!-- Put this in layouts/shortcodes/cawemo.html | |
To use it in hugo, get an Embed link for your diagram on cawemo.com, | |
then use it like this your post: |
This file contains hidden or 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
export function decodeCreateZBWorkerSig(config) { | |
const isShorthandSig = typeof config.taskTypeOrTaskHandler === 'function' | |
const taskHandler: ZB.ZBWorkerTaskHandler = isShorthandSig | |
? (config.taskTypeOrTaskHandler as ZB.ZBWorkerTaskHandler) | |
: (config.taskHandlerOrOptions as ZB.ZBWorkerTaskHandler) | |
const id: string | null = isShorthandSig | |
? (config.idOrTaskType as string) | |
: null | |
const taskType: string = isShorthandSig | |
? (config.idOrTaskType as string) |
This file contains hidden or 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
const config = decodeCreateZBWorkerSig({ | |
idOrTaskType, | |
onConnectionError, | |
optionsOrOnConnectionError, | |
taskHandlerOrOptions, | |
taskTypeOrTaskHandler, | |
}) |
This file contains hidden or 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
const zbWorker = zbc.createWorker('demo-service', handler) |
This file contains hidden or 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
public createWorker( | |
id: string | null, | |
taskType: string, | |
taskHandler: ZB.ZBWorkerTaskHandler, | |
options?: ZB.ZBWorkerOptions & ZB.ZBClientOptions, | |
onConnectionError?: ZB.ConnectionErrorHandler | undefined | |
): ZBWorker | |
public createWorker( | |
taskType: string, | |
taskHandler: ZB.ZBWorkerTaskHandler, |
This file contains hidden or 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
const zbWorker = zbc.createWorker(null, 'demo-service', handler) |