removed useless stuff

This commit is contained in:
Lorenzo Venerandi 2024-12-14 02:26:48 +01:00
parent 8ba95bfe0c
commit d86f1f79c3

View File

@ -6,6 +6,7 @@ import (
"gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasmcloud/messaging/types" "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasmcloud/messaging/types"
logger "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasi/logging/logging" logger "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasi/logging/logging"
//config "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasi/config/runtime" //config "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasi/config/runtime"
"time"
) )
type messagingConsumerAdapter struct { type messagingConsumerAdapter struct {
@ -22,12 +23,13 @@ func loop() cm.Result[string, struct{}, string] {
// TODO implement the logic to get the destination topic from the config // TODO implement the logic to get the destination topic from the config
// dest_topic := config.GetAll() // dest_topic := config.GetAll()
dest_topic := "test.reply" dest_topic := "test.reply"
counter := 0
// TASK // TASK
for true { for {
// generate random message // generate random message
data := []byte("Hello, World!") data := []byte("Hello, World! " + string(counter))
// Send reply // Send reply
reply := types.BrokerMessage{ reply := types.BrokerMessage{
@ -41,6 +43,15 @@ func loop() cm.Result[string, struct{}, string] {
return res return res
} }
counter++
if counter == 1000 {
break
}
// sleep for 1 second
time.Sleep(1 * time.Second)
} }
return cm.OK[cm.Result[string, struct{}, string]](struct{}{}) return cm.OK[cm.Result[string, struct{}, string]](struct{}{})