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
ea00044b
Commit
ea00044b
authored
Feb 24, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly include sender slot in handshake
parent
a2964318
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
20 additions
and
31 deletions
+20
-31
libcaf_core/caf/detail/stream_source_driver_impl.hpp
libcaf_core/caf/detail/stream_source_driver_impl.hpp
+2
-2
libcaf_core/caf/detail/stream_source_impl.hpp
libcaf_core/caf/detail/stream_source_impl.hpp
+2
-2
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
+2
-2
libcaf_core/caf/detail/stream_stage_impl.hpp
libcaf_core/caf/detail/stream_stage_impl.hpp
+2
-2
libcaf_core/caf/scheduled_actor.hpp
libcaf_core/caf/scheduled_actor.hpp
+0
-7
libcaf_core/caf/stream.hpp
libcaf_core/caf/stream.hpp
+1
-5
libcaf_core/caf/stream_manager.hpp
libcaf_core/caf/stream_manager.hpp
+1
-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
+4
-4
libcaf_core/test/native_streaming_classes.cpp
libcaf_core/test/native_streaming_classes.cpp
+4
-4
No files found.
libcaf_core/caf/detail/stream_source_driver_impl.hpp
View file @
ea00044b
...
...
@@ -61,8 +61,8 @@ public:
init
(
state_
);
}
handshake_tuple_type
make_handshake
()
const
override
{
return
std
::
tuple_cat
(
std
::
make_tuple
(
none
),
hs_
);
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
override
{
return
std
::
tuple_cat
(
std
::
make_tuple
(
stream_type
{
slot
}
),
hs_
);
}
void
pull
(
downstream
<
output_type
>&
out
,
size_t
num
)
override
{
...
...
libcaf_core/caf/detail/stream_source_impl.hpp
View file @
ea00044b
...
...
@@ -85,8 +85,8 @@ public:
return
hint
!=
out_
.
capacity
();
}
message
make_handshake
()
const
override
{
return
make_message_from_tuple
(
driver_
.
make_handshake
());
message
make_handshake
(
stream_slot
slot
)
const
override
{
return
make_message_from_tuple
(
driver_
.
make_handshake
(
slot
));
}
private:
...
...
libcaf_core/caf/detail/stream_stage_driver_impl.hpp
View file @
ea00044b
...
...
@@ -65,8 +65,8 @@ public:
init
(
state_
);
}
handshake_tuple_type
make_handshake
()
const
override
{
return
std
::
tuple_cat
(
std
::
make_tuple
(
none
),
hs_
);
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
override
{
return
std
::
tuple_cat
(
std
::
make_tuple
(
stream_type
{
slot
}
),
hs_
);
}
void
process
(
std
::
vector
<
input_type
>&&
batch
,
...
...
libcaf_core/caf/detail/stream_stage_impl.hpp
View file @
ea00044b
...
...
@@ -85,8 +85,8 @@ public:
CAF_LOG_ERROR
(
"received unexpected batch type (dropped)"
);
}
message
make_handshake
()
const
override
{
return
make_message_from_tuple
(
driver_
.
make_handshake
());
message
make_handshake
(
stream_slot
slot
)
const
override
{
return
make_message_from_tuple
(
driver_
.
make_handshake
(
slot
));
}
bool
congested
()
const
override
{
...
...
libcaf_core/caf/scheduled_actor.hpp
View file @
ea00044b
...
...
@@ -871,13 +871,6 @@ public:
return
bhvr_stack_
;
}
template
<
class
T
,
class
...
Ts
>
static
message
make_handshake
(
std
::
tuple
<
Ts
...
>&&
xs
)
{
stream
<
T
>
token
;
auto
ys
=
std
::
tuple_cat
(
std
::
forward_as_tuple
(
token
),
std
::
move
(
xs
));
return
make_message_from_tuple
(
std
::
move
(
ys
));
}
/*
/// Tries to add a new sink to the stream manager `mgr`.
/// @param mgr Pointer to the responsible stream manager.
...
...
libcaf_core/caf/stream.hpp
View file @
ea00044b
...
...
@@ -43,13 +43,9 @@ public:
stream
&
operator
=
(
stream
&&
)
=
default
;
stream
&
operator
=
(
const
stream
&
)
=
default
;
stream
(
none_t
=
none
)
:
slot_
(
0
)
{
// nop
}
/// Convenience constructor for returning the result of `self->new_stream`
/// and similar functions.
stream
(
stream_slot
id
,
stream_manager_ptr
sptr
=
nullptr
)
explicit
stream
(
stream_slot
id
=
0
,
stream_manager_ptr
sptr
=
nullptr
)
:
slot_
(
id
),
ptr_
(
std
::
move
(
sptr
))
{
// nop
...
...
libcaf_core/caf/stream_manager.hpp
View file @
ea00044b
...
...
@@ -183,7 +183,7 @@ protected:
/// Returns a type-erased `stream<T>` as handshake token for downstream
/// actors. Returns an empty message for sinks.
virtual
message
make_handshake
()
const
;
virtual
message
make_handshake
(
stream_slot
slot
)
const
;
/// Called whenever new credit becomes available. The default implementation
/// logs an error (sources are expected to override this hook).
...
...
libcaf_core/caf/stream_source_driver.hpp
View file @
ea00044b
...
...
@@ -60,7 +60,7 @@ public:
// -- pure virtual functions -------------------------------------------------
/// Generates handshake data for the next actor in the pipeline.
virtual
handshake_tuple_type
make_handshake
()
const
=
0
;
virtual
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
=
0
;
/// Generates more stream elements.
virtual
void
pull
(
downstream
<
output_type
>&
out
,
size_t
num
)
=
0
;
...
...
libcaf_core/caf/stream_stage_driver.hpp
View file @
ea00044b
...
...
@@ -63,7 +63,7 @@ public:
// -- pure virtual functions -------------------------------------------------
/// Generates handshake data for the next actor in the pipeline.
virtual
handshake_tuple_type
make_handshake
()
const
=
0
;
virtual
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
=
0
;
/// Processes a single batch.
virtual
void
process
(
std
::
vector
<
input_type
>&&
batch
,
...
...
libcaf_core/src/stream_manager.cpp
View file @
ea00044b
...
...
@@ -129,9 +129,9 @@ void stream_manager::send_handshake(strong_actor_ptr dest, stream_slot slot,
in_flight_promises_
.
emplace
(
slot
,
response_promise
{
self
()
->
ctrl
(),
client
,
fwd_stack
,
mid
});
dest
->
enqueue
(
make_mailbox_element
(
std
::
move
(
client
),
mid
,
std
::
move
(
fwd_stack
),
open_stream_msg
{
slot
,
make_handshake
(),
self_
->
ctrl
(),
dest
,
priority_
}),
make_mailbox_element
(
std
::
move
(
client
),
mid
,
std
::
move
(
fwd_stack
),
open_stream_msg
{
slot
,
make_handshake
(
slot
),
self_
->
ctrl
(),
dest
,
priority_
}),
self_
->
context
());
}
...
...
@@ -195,7 +195,7 @@ void stream_manager::output_closed(error) {
// nop
}
message
stream_manager
::
make_handshake
()
const
{
message
stream_manager
::
make_handshake
(
stream_slot
)
const
{
CAF_LOG_ERROR
(
"stream_manager::make_handshake called"
);
return
none
;
}
...
...
libcaf_core/test/native_streaming_classes.cpp
View file @
ea00044b
...
...
@@ -245,8 +245,8 @@ public:
// nop
}
handshake_tuple_type
make_handshake
()
const
override
{
return
std
::
make_tuple
(
none
);
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
override
{
return
std
::
make_tuple
(
stream_type
{
slot
}
);
}
void
pull
(
downstream
<
int
>&
out
,
size_t
hint
)
override
{
...
...
@@ -278,8 +278,8 @@ public:
// nop
}
handshake_tuple_type
make_handshake
()
const
override
{
return
std
::
make_tuple
(
none
);
handshake_tuple_type
make_handshake
(
stream_slot
slot
)
const
override
{
return
std
::
make_tuple
(
stream_type
{
slot
}
);
}
void
process
(
vector
<
int
>&&
batch
,
downstream
<
int
>&
out
)
override
{
...
...
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