Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
ae96552a
Commit
ae96552a
authored
Feb 06, 2017
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scheduled_actor::trigger_downstreams
parent
c5a3ee26
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
12 deletions
+22
-12
libcaf_core/caf/mixin/has_downstreams.hpp
libcaf_core/caf/mixin/has_downstreams.hpp
+4
-5
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+4
-0
libcaf_core/src/scheduled_actor.cpp
libcaf_core/src/scheduled_actor.cpp
+8
-1
libcaf_core/src/stream_source.cpp
libcaf_core/src/stream_source.cpp
+2
-2
libcaf_core/src/stream_stage.cpp
libcaf_core/src/stream_stage.cpp
+4
-4
No files found.
libcaf_core/caf/mixin/has_downstreams.hpp
View file @
ae96552a
...
...
@@ -45,11 +45,10 @@ public:
return
sec
::
downstream_already_exists
;
}
error
trigger_send
(
strong_actor_ptr
&
)
{
error
push
()
final
{
if
(
out
().
buf_size
()
>
0
)
out
().
policy
().
push
(
out
());
return
none
;
}
private:
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
ae96552a
...
...
@@ -447,6 +447,10 @@ public:
return
streams_
;
}
/// Tries to send more data on all downstream paths. Use this function to
/// manually trigger batches in a source after receiving more data to send.
void
trigger_downstreams
();
/// @cond PRIVATE
// -- timeout management -----------------------------------------------------
...
...
libcaf_core/src/scheduled_actor.cpp
View file @
ae96552a
...
...
@@ -258,7 +258,7 @@ scheduled_actor::resume(execution_unit* ctx, size_t max_throughput) {
return
resumable
::
resume_later
;
}
// -- scheduler callbacks ----------------------------------------------------
// -- scheduler callbacks ----------------------------------------------------
--
proxy_registry
*
scheduled_actor
::
proxy_registry_ptr
()
{
return
nullptr
;
...
...
@@ -272,6 +272,13 @@ void scheduled_actor::quit(error x) {
setf
(
is_terminated_flag
);
}
// -- stream management --------------------------------------------------------
void
scheduled_actor
::
trigger_downstreams
()
{
for
(
auto
&
s
:
streams_
)
s
.
second
->
push
();
}
// -- timeout management -------------------------------------------------------
uint32_t
scheduled_actor
::
request_timeout
(
const
duration
&
d
)
{
...
...
libcaf_core/src/stream_source.cpp
View file @
ae96552a
...
...
@@ -51,11 +51,11 @@ error stream_source::downstream_demand(strong_actor_ptr& hdl, size_t value) {
auto
size_hint
=
out_ptr_
->
policy
().
desired_buffer_size
(
*
out_ptr_
);
if
(
current_size
<
size_hint
)
generate
(
size_hint
-
current_size
);
return
trigger_send
(
hdl
);
return
push
(
);
}
// transmit cached elements before closing paths
if
(
buf_size
()
>
0
)
return
trigger_send
(
hdl
);
return
push
(
);
if
(
out_ptr_
->
remove_path
(
hdl
))
return
none
;
}
...
...
libcaf_core/src/stream_stage.cpp
View file @
ae96552a
...
...
@@ -44,8 +44,7 @@ error stream_stage::upstream_batch(strong_actor_ptr& hdl, size_t xs_size,
auto
err
=
in_ptr_
->
pull
(
hdl
,
xs_size
);
if
(
!
err
)
{
process_batch
(
xs
);
strong_actor_ptr
dummy
;
trigger_send
(
dummy
);
push
();
}
return
err
;
}
...
...
@@ -55,8 +54,9 @@ error stream_stage::downstream_demand(strong_actor_ptr& hdl, size_t value) {
if
(
path
)
{
path
->
open_credit
+=
value
;
if
(
out_ptr_
->
buf_size
()
>
0
)
{
return
trigger_send
(
hdl
);
}
if
(
in_ptr_
->
closed
())
{
return
push
();
}
if
(
in_ptr_
->
closed
())
{
if
(
!
out_ptr_
->
remove_path
(
hdl
))
{
return
sec
::
invalid_downstream
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment