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
6945c90b
Commit
6945c90b
authored
Jun 02, 2022
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code
parent
d4f07063
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
54 deletions
+0
-54
libcaf_core/test/async/publishing_queue.cpp
libcaf_core/test/async/publishing_queue.cpp
+0
-54
No files found.
libcaf_core/test/async/publishing_queue.cpp
deleted
100644 → 0
View file @
d4f07063
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#define CAF_SUITE async.publishing_queue
#include "caf/async/publishing_queue.hpp"
#include "core-test.hpp"
#include "caf/scheduled_actor/flow.hpp"
using
namespace
caf
;
namespace
{
struct
fixture
{
actor_system_config
cfg
;
actor_system
sys
;
fixture
()
:
sys
(
cfg
.
set
(
"caf.scheduler.max-threads"
,
2
))
{
// nop
}
};
}
// namespace
BEGIN_FIXTURE_SCOPE
(
fixture
)
SCENARIO
(
"publishing queues connect asynchronous producers to observers"
)
{
GIVEN
(
"a producer and a consumer, living in separate threads"
)
{
WHEN
(
"connecting producer and consumer via a publishing queue"
)
{
THEN
(
"the consumer receives all produced values in order"
)
{
auto
[
queue
,
src
]
=
async
::
make_publishing_queue
<
int
>
(
sys
,
100
);
auto
producer_thread
=
std
::
thread
{[
q
{
std
::
move
(
queue
)}]
{
for
(
int
i
=
0
;
i
<
5000
;
++
i
)
q
->
push
(
i
);
}};
std
::
vector
<
int
>
values
;
auto
consumer_thread
=
std
::
thread
{[
&
values
,
src
{
src
}]
{
src
.
blocking_for_each
([
&
](
int
x
)
{
values
.
emplace_back
(
x
);
});
}};
producer_thread
.
join
();
consumer_thread
.
join
();
std
::
vector
<
int
>
expected_values
;
expected_values
.
resize
(
5000
);
std
::
iota
(
expected_values
.
begin
(),
expected_values
.
end
(),
0
);
CHECK_EQ
(
values
,
expected_values
);
}
}
}
}
END_FIXTURE_SCOPE
()
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