+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/'
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
'/

hide empty description

state "UserActivity 1" as a1
state "UserActivity 2" as a2
state "UserActivity 3" as a3
state "UserActivity 4" as a4

a1: Primary Process
a2: Secondary Process 1
a3: Secondary Process 1
a4: Secondary Process 2

a3 --> a1
a3 --> a4
a1 --> a2
a4 --> a2
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/'
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
'/

box "Primary Process" #E0E0E0
participant "Primary Agent" as prim
participant "Scheduler" as scheduler
participant "UserActivity 1" as activity_1
end box

box "Secondary Process 1" #F0F0F0
participant "Secondary Agent 1" as sec_1
participant "UserActivity 2" as activity_2
participant "UserActivity 3" as activity_3
end box

box "Secondary Process 2" #F0F0F0
participant "Secondary Agent 2" as sec_2
participant "UserActivity 4" as activity_4
end box

== Process Startup ==

prim -> prim: create \nworker threads
sec_1 -> sec_1: create \nworker threads
sec_2 -> sec_2: create \nworker threads

sec_1 -> prim: connect
sec_2 -> prim: connect


prim -> scheduler: sync_remotes()
activate scheduler

scheduler -> sec_1: sync
scheduler -> sec_2: sync
sec_1 -> sec_1: sync
sec_2 -> sec_2: sync
sec_1 --> scheduler: ready
sec_2 --> scheduler: ready

scheduler --> prim: ok
deactivate scheduler


== Activity Init ==

note over scheduler, activity_4
Call each activity's init() method exactly once in an arbitrary order.
end note

prim -> scheduler: run()
activate scheduler

scheduler -> activity_1: init()
activity_1 -> activity_1: init
activity_1 --> scheduler: ready

scheduler -> sec_1: init(a2)
sec_1 -> activity_2: init()
activity_2 -> activity_2: init
activity_2 --> sec_1: ready
sec_1 --> scheduler: ready(a2)

scheduler -> sec_1: init(a3)
sec_1 -> activity_3: init()
activity_3 -> activity_3: init
activity_3 --> sec_1: ready
sec_1 --> scheduler: ready(a3)

scheduler -> sec_2: init(a4)
sec_2 -> activity_4: init()
activity_4 -> activity_4: init
activity_4 --> sec_2: ready
sec_2 --> scheduler: ready(a4)

== Main Loop ==

loop break on termination signal to Primary Process

note over scheduler, activity_4
Call each activity's step() method in the order defined by the activity graph.
end note

scheduler -> sec_1: step(a3)
note left: Step a3 first
sec_1 -> activity_3: step()
activity_3 --> sec_1: ready
sec_1 --> scheduler: ready(a3)

scheduler -> sec_2: step(a4)
note left: Step a1 and a4\nin parallel, but\nafter end of a3
sec_2 -> activity_4: step()
scheduler -> activity_1: step()
activity_1 --> scheduler: ready
activity_4 --> sec_2: ready
sec_2 --> scheduler: ready(a4)

scheduler -> sec_1: step(a2)
note left: Step a2 after\nend of a1 and a4
sec_1 -> activity_2: step()
activity_2 --> sec_1: ready
sec_1 --> scheduler: ready(a2)


hnote over scheduler
sleep until end
of cycle time
end note

end loop

== Activity Shutdown ==

note over scheduler, activity_4
Call each activity's shutdown() method exactly once in an arbitrary order.
end note

scheduler -> activity_1: shutdown()
activity_1 -> activity_1: shutdown
activity_1 --> scheduler: ready

scheduler -> sec_1: shutdown(a2)
sec_1 -> activity_2: shutdown()
activity_2 -> activity_2: shutdown
activity_2 --> sec_1: ready
sec_1 --> scheduler: ready(a2)

scheduler -> sec_1: shutdown(a3)
sec_1 -> activity_3: shutdown()
activity_3 -> activity_3: shutdown
activity_3 --> sec_1: ready
sec_1 --> scheduler: ready(a3)

scheduler -> sec_2: shutdown(a4)
sec_2 -> activity_4: shutdown()
activity_4 -> activity_4: shutdown
activity_4 --> sec_2: ready
sec_2 --> scheduler: ready(a4)

scheduler --> prim: ok

deactivate scheduler

Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/'
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
'/
allowmixing

package FEO <<feature>> as feat_feo {

struct "feo::agent::Primary" as feo_primary {
+ new(config: PrimaryConfig) -> Self
+ run(&mut self) -> Result
}

struct "feo::agent::Secondary" as feo_secondary {
+ new(config: SecondaryConfig) -> Self
+ fn run(self)
}

struct "feo::agent::PrimaryConfig" as feo_primary_config {
+ cycle_time : Duration
+ activity_dependencies : HashMap<ActivityId, Vec<ActivityId>>
+ recorder_ids : Vec<AgentId>
{field} + worker_assignments : Vec<(WorkerId, Vec<ActivityIdAndBuilder>)>
+ timeout : Duration
+ endpoint : NodeAddress,
}

struct "feo::agent::SecondaryConfig" as feo_secondary_config {
+ id: AgentId
{field} + worker_assignments: Vec<(WorkerId, Vec<ActivityIdAndBuilder>)>
+ timeout: Duration,
+ endpoint: NodeAddress,
}

struct "feo::scheduler::Scheduler" as feo_scheduler {
+ new(...) -> Self
+ run()
+ sync_remotes() -> Result
}

interface "feo::activity::Activity" as activity {
+ init()
+ step()
+ shutdown()
}

feo_primary --> activity: use
feo_primary --> feo_scheduler: use

feo_secondary --> activity: use

}

package "User Application" <<application>> as user_application {

component "Primary Process" as PP
component "Secondary Process" as SP

struct "UserActivity_1" as user_activity_1
struct "UserActivity_2" as user_activity_2

PP --> user_activity_1 : use
SP --> user_activity_2 : use

user_activity_1 ..|> activity : impl
user_activity_2 ..|> activity : impl
}

PP --> feo_primary : use
PP --> feo_primary_config : use
SP --> feo_secondary : use
SP --> feo_secondary_config : use

Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载