Closed finalclass closed 2 years ago
你的邮件已查收,谢谢!!! ------waterlemon
Thank you for the question. Yeah, there is a lack of documentation, and we are working on it.
The Cast
and Call
are gen.ServerProcess
methods and are available within an actor only (to be specific - within the actor's callbacks). To operate with an actor from outside, you should use gen.Process
methods: Send
method for async messaging (will be invoked HandleInfo callback) or Direct
to make sync calls to the actor (will be invoked HandleDirect).
gen.ServerProcess
is available as a first argument in the callbacks like Init, HandleCast, HandleCall etc. (see gen.ServerBehavior
interface)gen.Process
is an interface returned by Spawn method.just checked out pkg.go.dev - it has the latest version. Here are links you might find useful
https://pkg.go.dev/github.com/ergo-services/ergo@v1.999.202/gen#ServerProcess https://pkg.go.dev/github.com/ergo-services/ergo@v1.999.202/gen#Process https://pkg.go.dev/github.com/ergo-services/ergo@v1.999.202/gen#ServerBehavior
Thanks a lot for your answer. Indeed the docs are there. I got confused because the link on the ergo.services website leads to https://pkg.go.dev/github.com/halturin/ergo
Now all is clear. Thanks again. ergo is AMAZING!
oh, sorry for that :) yeah, it should have been updated.
Thank you for the great work you have done, I'm very excited about this library.
I think there is a problem with documentation. On pkg.go.dev there is an old version of documentation.
I browsed all the examples and I couldn't find information on how to make a
Call
request to a gen server process. What I wish is to get a process by name and then make a Call to it so that HandleCall will fire. In erlang it's easy and can be achieved withgen_server:call(pid,...)
but inergo
it seams that I need to get hold of thegen.ServerProcess
struct instance which appears to not be exposed.Please help me with that.