@@ -126,9 +126,16 @@ use bevy::prelude::{Entity, In};
126
126
/// ```
127
127
#[ non_exhaustive]
128
128
pub struct BlockingService < Request , Streams : StreamPack = ( ) > {
129
+ /// The input data of the request
129
130
pub request : Request ,
130
- pub provider : Entity ,
131
+ /// The buffer to hold stream output data until the function is finished
131
132
pub streams : Streams :: Buffer ,
133
+ /// The entity providing the service
134
+ pub provider : Entity ,
135
+ /// The node in a workflow or impulse chain that asked for the service
136
+ pub source : Entity ,
137
+ /// The unique session ID for the workflow
138
+ pub session : Entity ,
132
139
}
133
140
134
141
/// Use this to reduce bracket noise when you need `In<BlockingService<R>>`.
@@ -142,9 +149,18 @@ pub type InBlockingService<Request, Streams = ()> = In<BlockingService<Request,
142
149
/// ECS asynchronously while it is polled from inside the task pool.
143
150
#[ non_exhaustive]
144
151
pub struct AsyncService < Request , Streams : StreamPack = ( ) > {
152
+ /// The input data of the request
145
153
pub request : Request ,
154
+ /// The channel that allows querying and syncing with the world while the
155
+ /// service runs asynchronously. Use the [`Channel::streams`] method to
156
+ /// send stream output data from the service.
146
157
pub channel : Channel < Streams > ,
158
+ /// The entity providing the service
147
159
pub provider : Entity ,
160
+ /// The node in a workflow or impulse chain that asked for the service
161
+ pub source : Entity ,
162
+ /// The unique session ID for the workflow
163
+ pub session : Entity ,
148
164
}
149
165
150
166
/// Use this to reduce backet noise when you need `In<AsyncService<R, S>>`.
@@ -155,8 +171,14 @@ pub type InAsyncService<Request, Streams = ()> = In<AsyncService<Request, Stream
155
171
/// not associated with any entity.
156
172
#[ non_exhaustive]
157
173
pub struct BlockingHandler < Request , Streams : StreamPack = ( ) > {
174
+ /// The input data of the request
158
175
pub request : Request ,
176
+ /// The buffer to hold stream output data until the function is finished
159
177
pub streams : Streams :: Buffer ,
178
+ /// The node in a workflow or impulse chain that asked for the callback
179
+ pub source : Entity ,
180
+ /// The unique session ID for the workflow
181
+ pub session : Entity ,
160
182
}
161
183
162
184
/// Use AsyncHandler to indicate that your system or function is meant to define
@@ -165,8 +187,16 @@ pub struct BlockingHandler<Request, Streams: StreamPack = ()> {
165
187
/// will be polled by the async task pool.
166
188
#[ non_exhaustive]
167
189
pub struct AsyncHandler < Request , Streams : StreamPack = ( ) > {
190
+ /// The input data of the request
168
191
pub request : Request ,
192
+ /// The channel that allows querying and syncing with the world while the
193
+ /// service runs asynchronously. Use the [`Channel::streams`] method to
194
+ /// send stream output data from the service.
169
195
pub channel : Channel < Streams > ,
196
+ /// The node in a workflow or impulse chain that asked for the callback
197
+ pub source : Entity ,
198
+ /// The unique session ID for the workflow
199
+ pub session : Entity ,
170
200
}
171
201
172
202
/// Use BlockingMap to indicate that your function is meant to define a blocking
@@ -175,8 +205,14 @@ pub struct AsyncHandler<Request, Streams: StreamPack = ()> {
175
205
/// implement [`FnOnce`].
176
206
#[ non_exhaustive]
177
207
pub struct BlockingMap < Request , Streams : StreamPack = ( ) > {
208
+ /// The input data of the request
178
209
pub request : Request ,
210
+ /// The buffer to hold stream output data until the function is finished
179
211
pub streams : Streams :: Buffer ,
212
+ /// The node in a workflow or impulse chain that asked for the callback
213
+ pub source : Entity ,
214
+ /// The unique session ID for the workflow
215
+ pub session : Entity ,
180
216
}
181
217
182
218
/// Use AsyncMap to indicate that your function is meant to define an async
0 commit comments