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
290f7d8e
Commit
290f7d8e
authored
Feb 26, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add finalize with error argument to all drivers
parent
64c6a025
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
6 deletions
+35
-6
libcaf_core/caf/detail/stream_sink_driver_impl.hpp
libcaf_core/caf/detail/stream_sink_driver_impl.hpp
+1
-1
libcaf_core/caf/detail/stream_sink_impl.hpp
libcaf_core/caf/detail/stream_sink_impl.hpp
+5
-1
libcaf_core/caf/detail/stream_source_impl.hpp
libcaf_core/caf/detail/stream_source_impl.hpp
+5
-0
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
+1
-1
libcaf_core/caf/detail/stream_stage_impl.hpp
libcaf_core/caf/detail/stream_stage_impl.hpp
+5
-0
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+4
-0
libcaf_core/caf/stream_sink_driver.hpp
libcaf_core/caf/stream_sink_driver.hpp
+5
-1
libcaf_core/caf/stream_source_driver.hpp
libcaf_core/caf/stream_source_driver.hpp
+1
-1
libcaf_core/caf/stream_stage_driver.hpp
libcaf_core/caf/stream_stage_driver.hpp
+1
-1
libcaf_core/src/stream_manager.cpp
libcaf_core/src/stream_manager.cpp
+7
-0
No files found.
libcaf_core/caf/detail/stream_sink_driver_impl.hpp
View file @
290f7d8e
...
@@ -54,7 +54,7 @@ public:
...
@@ -54,7 +54,7 @@ public:
return
trait
::
process
::
invoke
(
process_
,
state_
,
std
::
move
(
xs
));
return
trait
::
process
::
invoke
(
process_
,
state_
,
std
::
move
(
xs
));
}
}
message
finalize
()
override
{
message
make_final_result
()
override
{
return
trait
::
finalize
::
invoke
(
finalize_
,
state_
);
return
trait
::
finalize
::
invoke
(
finalize_
,
state_
);
}
}
...
...
libcaf_core/caf/detail/stream_sink_impl.hpp
View file @
290f7d8e
...
@@ -71,7 +71,11 @@ public:
...
@@ -71,7 +71,11 @@ public:
protected:
protected:
message
make_final_result
()
override
{
message
make_final_result
()
override
{
return
driver_
.
finalize
();
return
driver_
.
make_final_result
();
}
void
finalize
(
const
error
&
reason
)
override
{
driver_
.
finalize
(
reason
);
}
}
private:
private:
...
...
libcaf_core/caf/detail/stream_source_impl.hpp
View file @
290f7d8e
...
@@ -89,6 +89,11 @@ public:
...
@@ -89,6 +89,11 @@ public:
return
make_message_from_tuple
(
driver_
.
make_handshake
(
slot
));
return
make_message_from_tuple
(
driver_
.
make_handshake
(
slot
));
}
}
protected:
void
finalize
(
const
error
&
reason
)
override
{
driver_
.
finalize
(
reason
);
}
private:
private:
bool
at_end_
;
bool
at_end_
;
Driver
driver_
;
Driver
driver_
;
...
...
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
View file @
290f7d8e
...
@@ -74,7 +74,7 @@ public:
...
@@ -74,7 +74,7 @@ public:
trait
::
process
::
invoke
(
process_
,
state_
,
std
::
move
(
batch
),
out
);
trait
::
process
::
invoke
(
process_
,
state_
,
std
::
move
(
batch
),
out
);
}
}
void
finalize
()
override
{
void
finalize
(
const
error
&
)
override
{
return
fin_
(
state_
);
return
fin_
(
state_
);
}
}
...
...
libcaf_core/caf/detail/stream_stage_impl.hpp
View file @
290f7d8e
...
@@ -93,6 +93,11 @@ public:
...
@@ -93,6 +93,11 @@ public:
return
out_
.
capacity
()
==
0
;
return
out_
.
capacity
()
==
0
;
}
}
protected:
void
finalize
(
const
error
&
reason
)
override
{
driver_
.
finalize
(
reason
);
}
private:
private:
driver_type
driver_
;
driver_type
driver_
;
scatterer_type
out_
;
scatterer_type
out_
;
...
...
libcaf_core/caf/stream_manager.hpp
View file @
290f7d8e
...
@@ -173,6 +173,10 @@ public:
...
@@ -173,6 +173,10 @@ public:
}
}
protected:
protected:
// -- implementation hooks ---------------------------------------------------
virtual
void
finalize
(
const
error
&
reason
);
// -- implementation hooks for sinks -----------------------------------------
// -- implementation hooks for sinks -----------------------------------------
/// Called when the gatherer closes to produce the final stream result for
/// Called when the gatherer closes to produce the final stream result for
...
...
libcaf_core/caf/stream_sink_driver.hpp
View file @
290f7d8e
...
@@ -46,10 +46,14 @@ public:
...
@@ -46,10 +46,14 @@ public:
// -- virtual functions ------------------------------------------------------
// -- virtual functions ------------------------------------------------------
/// Cleans up any state and produces a result message.
/// Cleans up any state and produces a result message.
virtual
message
finalize
()
{
virtual
message
make_final_result
()
{
return
make_message
();
return
make_message
();
}
}
virtual
void
finalize
(
const
error
&
)
{
// nop
}
// -- pure virtual functions -------------------------------------------------
// -- pure virtual functions -------------------------------------------------
/// Processes a single batch.
/// Processes a single batch.
...
...
libcaf_core/caf/stream_source_driver.hpp
View file @
290f7d8e
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
// -- virtual functions ------------------------------------------------------
// -- virtual functions ------------------------------------------------------
/// Cleans up any state.
/// Cleans up any state.
virtual
void
finalize
()
{
virtual
void
finalize
(
const
error
&
)
{
// nop
// nop
}
}
...
...
libcaf_core/caf/stream_stage_driver.hpp
View file @
290f7d8e
...
@@ -56,7 +56,7 @@ public:
...
@@ -56,7 +56,7 @@ public:
// -- virtual functions ------------------------------------------------------
// -- virtual functions ------------------------------------------------------
/// Cleans up any state.
/// Cleans up any state.
virtual
void
finalize
()
{
virtual
void
finalize
(
const
error
&
)
{
// nop
// nop
}
}
...
...
libcaf_core/src/stream_manager.cpp
View file @
290f7d8e
...
@@ -91,6 +91,8 @@ void stream_manager::handle(stream_slots slots, upstream_msg::forced_drop& x) {
...
@@ -91,6 +91,8 @@ void stream_manager::handle(stream_slots slots, upstream_msg::forced_drop& x) {
void
stream_manager
::
stop
()
{
void
stream_manager
::
stop
()
{
CAF_LOG_TRACE
(
""
);
CAF_LOG_TRACE
(
""
);
out
().
close
();
out
().
close
();
error
tmp
;
finalize
(
tmp
);
self_
->
erase_inbound_paths_later
(
this
);
self_
->
erase_inbound_paths_later
(
this
);
if
(
!
promises_
.
empty
())
if
(
!
promises_
.
empty
())
deliver_promises
(
make_final_result
());
deliver_promises
(
make_final_result
());
...
@@ -106,6 +108,7 @@ void stream_manager::abort(error reason) {
...
@@ -106,6 +108,7 @@ void stream_manager::abort(error reason) {
in_flight_promises_
.
clear
();
in_flight_promises_
.
clear
();
}
}
out
().
abort
(
reason
);
out
().
abort
(
reason
);
finalize
(
reason
);
self_
->
erase_inbound_paths_later
(
this
,
std
::
move
(
reason
));
self_
->
erase_inbound_paths_later
(
this
,
std
::
move
(
reason
));
}
}
...
@@ -182,6 +185,10 @@ void stream_manager::deliver_promises(message x) {
...
@@ -182,6 +185,10 @@ void stream_manager::deliver_promises(message x) {
promises_
.
clear
();
promises_
.
clear
();
}
}
void
stream_manager
::
finalize
(
const
error
&
)
{
// nop
}
message
stream_manager
::
make_final_result
()
{
message
stream_manager
::
make_final_result
()
{
return
none
;
return
none
;
}
}
...
...
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