Compare commits
No commits in common. "cdc80d0b5397b5911b6a2d26d0b0440c1d2beeb5" and "8ba95bfe0c42bcbd8c31a0d6833fc3ee987ff044" have entirely different histories.
cdc80d0b53
...
8ba95bfe0c
@ -49,4 +49,4 @@ WORKDIR /app
|
||||
|
||||
# Install go dependencies, build the wasm module, push it to the registry
|
||||
#CMD ["sh", "-c", "go mod download && go mod verify && go mod tidy && wash build && wash push $REGISTRY build/*_s.wasm"]
|
||||
CMD ["sh", "-c", "go env -w GOFLAGS=-buildvcs=false && go mod download && go mod verify && wash build && wash push $REGISTRY build/*.wasm"]
|
||||
CMD ["sh", "-c", "go env -w GOFLAGS=-buildvcs=false && go mod download && go mod verify && wash build && wash push $REGISTRY build/*_s.wasm"]
|
1
main.go
1
main.go
@ -2,6 +2,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasmcloud/messaging/handler"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
15
messaging.go
15
messaging.go
@ -6,7 +6,6 @@ import (
|
||||
"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"
|
||||
//config "gitea.rebus.ninja/lore/wasm-nats-producer-client/gen/wasi/config/runtime"
|
||||
"time"
|
||||
)
|
||||
|
||||
type messagingConsumerAdapter struct {
|
||||
@ -23,13 +22,12 @@ func loop() cm.Result[string, struct{}, string] {
|
||||
// TODO implement the logic to get the destination topic from the config
|
||||
// dest_topic := config.GetAll()
|
||||
dest_topic := "test.reply"
|
||||
counter := 0
|
||||
|
||||
// TASK
|
||||
for {
|
||||
for true {
|
||||
|
||||
// generate random message
|
||||
data := []byte("Hello, World! " + string(counter))
|
||||
data := []byte("Hello, World!")
|
||||
|
||||
// Send reply
|
||||
reply := types.BrokerMessage{
|
||||
@ -43,15 +41,6 @@ func loop() cm.Result[string, struct{}, string] {
|
||||
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{}{})
|
||||
|
Loading…
Reference in New Issue
Block a user