11export Carrier, send_to_other, reply_to_other, send_and_wait_for_answers, send_awaitable, schedule_using, others
22
3+ """
4+ Carrier
5+
6+ An abstract type representing a generic data/communication carrier in the system.
7+ Concrete subtypes should implement specific carrier behaviors and properties.
8+ """
39abstract type Carrier end
410
11+ """
12+ send_to_other(carrier::Carrier, content_data::Any, receiver::Any)
13+
14+ Sends `content_data` using the specified `carrier` to the given `receiver`.
15+
16+ # Arguments
17+ - `carrier::Carrier`: The carrier object responsible for sending the data.
18+ - `content_data::Any`: The data to be sent.
19+ - `receiver::Any`: The target receiver of the data.
20+
21+ # Returns
22+ - The result of the send operation, which may vary depending on the implementation.
23+
24+ """
525function send_to_other (carrier:: Carrier , content_data:: Any , receiver:: Any )
626 throw (" NotImplemented" )
727end
28+
29+
30+ """
31+ reply_to_other(carrier::Carrier, content_data::Any, meta::Any)
32+
33+ Reply using the given `carrier` to another entity, using the provided `content_data` and
34+ `meta` information.
35+
36+ # Arguments
37+ - `carrier::Carrier`: The carrier object responsible for communication.
38+ - `content_data::Any`: The data to be sent in the reply.
39+ - `meta::Any`: Additional metadata associated with the reply.
40+
41+ # Returns
42+ - The result of the reply operation, depending on the implementation.
43+
44+ # Notes
45+ - The specific behavior depends on the implementation details of the `Carrier` type.
46+ """
847function reply_to_other (carrier:: Carrier , content_data:: Any , meta:: Any )
948 throw (" NotImplemented" )
1049end
50+
51+
52+ """
53+ send_and_wait_for_answers(carrier::Carrier, content_data::Any, receivers::Any)
54+
55+ Sends `content_data` using `carrier` to the given `receivers` and waits for their responses.
56+
57+ # Arguments
58+ - `carrier::Carrier`: The carrier object responsible for sending the data.
59+ - `content_data::Any`: The data to be sent to the receivers.
60+ - `receivers::Any`: The target receivers to which the data will be sent.
61+
62+ # Returns
63+ Returns the responses received from the receivers after sending the data.
64+
65+ # Notes
66+ This function blocks execution until all expected answers are received from the receivers.
67+ """
1168function send_and_wait_for_answers (carrier:: Carrier , content_data:: Any , receivers:: Any )
1269 throw (" NotImplemented" )
1370end
71+
72+
73+ """
74+ send_awaitable(carrier::Carrier, content_data::Any, receiver::Any)
75+
76+ Sends an awaitable message using the specified `carrier` to the given `receiver` with the provided `content_data`.
77+
78+ # Arguments
79+ - `carrier::Carrier`: The carrier object responsible for message transmission.
80+ - `content_data::Any`: The data to be sent in the message.
81+ - `receiver::Any`: The target recipient of the message.
82+
83+ # Returns
84+ Returns an awaitable object or handle that can be used to track the completion or response of the sent message.
85+ """
1486function send_awaitable (carrier:: Carrier , content_data:: Any , receiver:: Any )
1587 throw (" NotImplemented $carrier $content_data $receiver " )
1688end
89+
90+ """
91+ Base.wait(carrier::Carrier, waitable::Any)
92+
93+ Waits for the specified `waitable` object to become ready or complete within the context of the given `carrier`.
94+ This function integrates with the `Carrier`'s scheduling or resource management logic to handle asynchronous or blocking operations.
95+
96+ # Arguments
97+ - `carrier::Carrier`: The carrier instance managing the waiting operation.
98+ - `waitable::Any`: The object or resource to wait for. This can be any type that supports waiting semantics.
99+
100+ # Notes
101+ The function blocks until the `waitable` is ready or the operation is complete.
102+ """
17103function Base. wait (carrier:: Carrier , waitable:: Any )
18104 throw (" NotImplemented" )
19105end
106+
107+ """
108+ schedule_using(carrier::Carrier, to_be_scheduled::Function, delay_s::Float64)
109+
110+ Schedules the execution of the provided function `to_be_scheduled` using the specified `carrier` after a delay of `delay_s` seconds.
111+
112+ # Arguments
113+ - `carrier::Carrier`: The carrier object responsible for scheduling.
114+ - `to_be_scheduled::Function`: The function to be executed after the delay.
115+ - `delay_s::Float64`: The delay in seconds before executing the function.
116+
117+ # Returns
118+ - Implementation-dependent. Typically, returns a handle or status indicating the scheduled task.
119+ """
20120function schedule_using (carrier:: Carrier , to_be_scheduled:: Function , delay_s:: Float64 )
21121 throw (" NotImplemented" )
22122end
123+
124+ """
125+ others(carrier::Carrier, participant_id::String)
126+
127+ Returns a collection of participants in the given `carrier` excluding the participant with the specified `participant_id`.
128+
129+ # Arguments
130+ - `carrier::Carrier`: The carrier object containing participants.
131+ - `participant_id::String`: The identifier of the participant to exclude.
132+
133+ # Returns
134+ - A collection (e.g., array or set) of participants other than the one with `participant_id`.
135+ """
23136function others (carrier:: Carrier , participant_id:: String )
24137 throw (" NotImplemented" )
25138end
0 commit comments