alepha@docs:~/docs/.content/release/framework/docs/reference/providers$
cat MemoryMqttClientProvider.md | pretty
1 min read
Last commit:

#MemoryMqttClientProvider

#Import

typescript
1import { MemoryMqttClientProvider } from "@alepha/mqtt";

#Overview

MQTT client on an in-process broker: no socket, no timing.

Selected by AlephaMqtt when MQTT_URL is unset, and in the browser and on workerd. It is what the topic provider, @alepha/sparkplug and apps test on. Its broker is a MemoryMqttBroker, one per container unless shared with useBroker():

ts
1const device = Alepha.create().with(AlephaMqtt);2const app = Alepha.create().with(AlephaMqtt);3app.inject(MemoryMqttClientProvider).useBroker(device.inject(MemoryMqttBroker));

publish() resolves once every subscriber's callbacks have run.