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
0731e31d
Commit
0731e31d
authored
Feb 23, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `stream_manager::continuous` property
parent
74480828
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
libcaf_core/caf/detail/stream_sink_impl.hpp
libcaf_core/caf/detail/stream_sink_impl.hpp
+1
-1
libcaf_core/caf/detail/stream_stage_impl.hpp
libcaf_core/caf/detail/stream_stage_impl.hpp
+2
-2
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+19
-0
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+2
-1
No files found.
libcaf_core/caf/detail/stream_sink_impl.hpp
View file @
0731e31d
...
...
@@ -55,7 +55,7 @@ public:
}
bool
done
()
const
override
{
return
this
->
inbound_paths_
.
empty
();
return
!
this
->
continuous
()
&&
this
->
inbound_paths_
.
empty
();
}
void
handle
(
inbound_path
*
,
downstream_msg
::
batch
&
x
)
override
{
...
...
libcaf_core/caf/detail/stream_stage_impl.hpp
View file @
0731e31d
...
...
@@ -68,8 +68,8 @@ public:
}
bool
done
()
const
override
{
return
this
->
pending_handshakes_
==
0
&&
this
->
inbound_paths_
.
empty
()
&&
out_
.
clean
();
return
!
this
->
continuous
()
&&
this
->
pending_handshakes_
==
0
&&
this
->
inbound_paths_
.
empty
()
&&
out_
.
clean
();
}
void
handle
(
inbound_path
*
,
downstream_msg
::
batch
&
x
)
override
{
...
...
libcaf_core/caf/stream_manager.hpp
View file @
0731e31d
...
...
@@ -143,6 +143,21 @@ public:
/// Calls `x.deliver()`
void
deliver_promises
(
message
x
);
// -- properties -------------------------------------------------------------
/// Returns whether this stream remains open even if no in- or outbound paths
/// exist. The default is `false`. Does not keep a source alive past the
/// point where its driver returns `done() == true`.
inline
bool
continuous
()
const
noexcept
{
return
continuous_
;
}
/// Sets whether this stream remains open even if no in- or outbound paths
/// exist.
inline
void
continuous
(
bool
x
)
noexcept
{
continuous_
=
x
;
}
// -- inline functions -------------------------------------------------------
inline
local_actor
*
self
()
{
...
...
@@ -196,6 +211,10 @@ protected:
/// Stores promises while a handshake is active. The sink at the associated
/// key becomes responsible for the promise after receiving `ack_open`.
std
::
map
<
stream_slot
,
response_promise
>
in_flight_promises_
;
/// Stores whether this stream shall remain open even if no in- or outbound
/// paths exist.
bool
continuous_
;
};
/// A reference counting pointer to a `stream_manager`.
...
...
libcaf_core/src/stream_manager.cpp
View file @
0731e31d
...
...
@@ -37,7 +37,8 @@ namespace caf {
stream_manager
::
stream_manager
(
local_actor
*
selfptr
,
stream_priority
prio
)
:
self_
(
selfptr
),
pending_handshakes_
(
0
),
priority_
(
prio
)
{
priority_
(
prio
),
continuous_
(
false
)
{
// nop
}
...
...
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