Replies: 6 comments 1 reply
-
runnerIntroIn the concept below I outline a yaml configuration where I show the most features I would love to have in a runner. The runner would be custom compiled with some easy instructions so it can serve for example "shared.proto.userpb.v1". The Dreamrunner:
name: "user_register"
version: v0.0.1
arg: shared.proto.userpb.v1.UserReq
result: shared.proto.userpb.v1.UserResponse
hooks:
- name: checked
arg: shared.proto.userpb.v1.User
- name: notified
arg: shared.proto.userpb.v1.User
- name: verified
arg: shared.proto.userpb.v1.User
- name: failed
arg: shared.proto.userpb.v1.User
- name: registered
arg: shared.proto.userpb.v1.User
# run is the pipeline to call
run:
- description: Verify the User
action: orb_call
service: user.svc.orb.org
endpoint: User.Verify
success:
- description: Send verfication mail
action: orb_call
service: mail.svc.orb.org
endpoint: MailUser.Verify
# Means keep the previous result
pipe: false
- description: Wait for answer
action: orb_poll_call
service: user.svc.orb.org
endpoint: User.Verified
- hook: checked
- action: orb_call
# orb_call or better go-orb/client can find an endpoint without knowing the service.
# service: db.svc.orb.org
endpoint: DBUser.Store
success:
- action: orb_call
service: mail.svc.orb.org
endpoint: MailUser.Notify
- description: Do something in parallel
action: orb_parallel
run:
- action: orb_call
- action: orb_call
sucess:
- hook: registered
error:
- hook: failed
- action: orb_return_err |
Beta Was this translation helpful? Give feedback.
-
Actors - theory |
Beta Was this translation helpful? Give feedback.
-
Actors - junior point of view
go-orb supports components: type Component interface {
// Start the component. E.g. connect to the broker.
Start() error
// Stop the component. E.g. disconnect from the broker.
// The context will contain a timeout, and cancelation should be respected.
Stop(context.Context) error
// Type returns the component type, e.g. broker.
Type() string
// String returns the component plugin name.
String() string
} There are two kinds of components:
active components of go-orb are already async internal applications and without much efforts can be actors The hardest part of adding Actors - changing of mindset, not interface |
Beta Was this translation helpful? Give feedback.
-
go-orb components as actors: type Sender interface {
Send(msg TBD)
}
type Component interface {
// Async Start, result will be returned as message
Start(ack Sender)
// Async Stop, result will be returned as message
Stop(ctx context.Context, ack Sender)
Type() string
String() string
// Passive components should return nil, err
Mailbox() (Sender, error)
} no need to call components Actors. Enough to mention similarity in readme, doc and tags |
Beta Was this translation helpful? Give feedback.
-
@g41797 hi, just watched the youtube video referenced. From what I understand, the actor model is just a different design pattern to set up a distributed system. Orb provides the fundamental building blocks (interfaces + implementations) to build any distributed system, with whatever communication style you prefer sync or async, over rpc or event messages, and with that provides the building block to implement an actor model distributed system. It's an interesting paradigm, although I am not sure yet if I'd design my services this way personally, it should be possible. Is there anything fundamental that you would like to see in the Orb framework to aid in setting up an actor model architecture? I have no background knowledge on the actor model so if I am misunderstanding something please fill me in |
Beta Was this translation helpful? Give feedback.
-
@jochumdev wrote in his e-mail: Just found dagu is that something we could implement/add? Great! You found what I tried and could not explain - Use cases:
Usual flow of go-orb based process (simplified ofc.):
For this or similar flows current architecture is good enough. Like moving from non multi-threaded OS and APIs to multi-threading with well defined MT communication. Many years ago this kind of s/w called Application server |
Beta Was this translation helpful? Give feedback.
-
@g41797 brought up the idea of adding 'Actors' to go-orb.
Actors in dapr are described here: https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview/
and here https://www.microsoft.com/en-us/research/project/orleans-virtual-actors/ - the Overview is very informative.
Beta Was this translation helpful? Give feedback.
All reactions