go-sdk/examples/actor
Dmitry Shmulevich a38be4e38b
replace license headers (#232)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-14 12:06:12 -08:00
..
api replace license headers (#232) 2021-12-14 12:06:12 -08:00
client replace license headers (#232) 2021-12-14 12:06:12 -08:00
config Feat: Add Go-sdk Actor Support (#196) 2021-11-02 14:45:27 -07:00
serving replace license headers (#232) 2021-12-14 12:06:12 -08:00
README.md Feat: Add Go-sdk Actor Support (#196) 2021-11-02 14:45:27 -07:00

README.md

Dapr Actor Example with go-sdk

Step

Prepare

  • Dapr installed

Run Actor Server

dapr run --app-id actor-serving \
         --app-protocol http \
         --app-port 8080 \
         --dapr-http-port 3500 \
         --log-level debug \
         --components-path ./config \
         go run ./serving/main.go

Run Actor Client

dapr run --app-id actor-client \
         --log-level debug \
         --components-path ./config \
         go run ./client/main.go

Cleanup

dapr stop --app-id  actor-serving
(lsof -i:8080 | grep main) | awk '{print $2}' | xargs  kill

Result

  • client side
== APP == dapr client initializing for: 127.0.0.1:55776
== APP == get user result =  &{abc 123}
== APP == get invoke result =  laurence
== APP == get post result =  laurence
== APP == get result =  get result
== APP == start timer
== APP == stop timer
== APP == start reminder
== APP == stop reminder
== APP == get user = {Name: Age:1}
== APP == get user = {Name: Age:2}
✅  Exited App successfully

  • server side

== APP == call get user req =  &{abc 123}
== APP == get req =  laurence
== APP == get post request =  laurence
== APP == get req =  hello
== APP == get req =  hello
== APP == receive reminder =  testReminderName  state =  "hello" duetime =  5s period =  5s
== APP == receive reminder =  testReminderName  state =  "hello" duetime =  5s period =  5s