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
82a9823c
Commit
82a9823c
authored
Aug 01, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove obsolete files
parent
8996b00c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
184 deletions
+0
-184
libcaf_core/src/decorator/splitter.cpp
libcaf_core/src/decorator/splitter.cpp
+0
-114
libcaf_core/src/type_id.cpp
libcaf_core/src/type_id.cpp
+0
-31
libcaf_core/test/detail/message_builder_element.cpp
libcaf_core/test/detail/message_builder_element.cpp
+0
-39
No files found.
libcaf_core/src/decorator/splitter.cpp
deleted
100644 → 0
View file @
8996b00c
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/decorator/splitter.hpp"
#include "caf/actor_system.hpp"
#include "caf/default_attachable.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/response_promise.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/detail/disposer.hpp"
#include "caf/detail/sync_request_bouncer.hpp"
namespace
caf
::
decorator
{
namespace
{
struct
splitter_state
{
response_promise
rp
;
message
result
;
size_t
pending
;
};
behavior
fan_out_fan_in
(
stateful_actor
<
splitter_state
>*
self
,
const
std
::
vector
<
strong_actor_ptr
>&
workers
)
{
auto
f
=
[
=
](
local_actor
*
,
message
&
msg
)
->
result
<
message
>
{
self
->
state
.
rp
=
self
->
make_response_promise
();
self
->
state
.
pending
=
workers
.
size
();
// request().await() has LIFO ordering
for
(
auto
i
=
workers
.
rbegin
();
i
!=
workers
.
rend
();
++
i
)
// TODO: maybe infer some useful timeout or use config parameter?
self
->
request
(
actor_cast
<
actor
>
(
*
i
),
infinite
,
msg
)
.
await
(
[
=
]()
{
// nop
},
[
=
](
error
&
err
)
mutable
{
if
(
err
==
sec
::
unexpected_response
)
{
self
->
state
.
result
+=
std
::
move
(
err
.
context
());
if
(
--
self
->
state
.
pending
==
0
)
self
->
state
.
rp
.
deliver
(
std
::
move
(
self
->
state
.
result
));
}
else
{
self
->
state
.
rp
.
deliver
(
err
);
self
->
quit
();
}
});
return
delegated
<
message
>
{};
};
self
->
set_default_handler
(
f
);
return
[]
{
// nop
};
}
}
// namespace
splitter
::
splitter
(
std
::
vector
<
strong_actor_ptr
>
workers
,
message_types_set
msg_types
)
:
monitorable_actor
(
actor_config
{}.
add_flag
(
is_actor_dot_decorator_flag
)),
num_workers
(
workers
.
size
()),
workers_
(
std
::
move
(
workers
)),
msg_types_
(
std
::
move
(
msg_types
))
{
// composed actor has dependency on constituent actors by default;
// if either constituent actor is already dead upon establishing
// the dependency, the actor is spawned dead
auto
addr
=
address
();
for
(
auto
&
worker
:
workers_
)
worker
->
get
()
->
attach
(
default_attachable
::
make_monitor
(
actor_cast
<
actor_addr
>
(
worker
),
addr
));
}
void
splitter
::
enqueue
(
mailbox_element_ptr
what
,
execution_unit
*
context
)
{
auto
down_msg_handler
=
[
&
](
down_msg
&
dm
)
{
// quit if any worker fails
cleanup
(
std
::
move
(
dm
.
reason
),
context
);
};
if
(
handle_system_message
(
*
what
,
context
,
false
,
down_msg_handler
))
return
;
std
::
vector
<
strong_actor_ptr
>
workers
;
workers
.
reserve
(
num_workers
);
error
fail_state
;
shared_critical_section
([
&
]
{
workers
=
workers_
;
fail_state
=
fail_state_
;
});
if
(
workers
.
empty
())
{
bounce
(
what
,
fail_state
);
return
;
}
auto
helper
=
context
->
system
().
spawn
(
fan_out_fan_in
,
std
::
move
(
workers
));
helper
->
enqueue
(
std
::
move
(
what
),
context
);
}
splitter
::
message_types_set
splitter
::
message_types
()
const
{
return
msg_types_
;
}
}
// namespace caf::decorator
libcaf_core/src/type_id.cpp
deleted
100644 → 0
View file @
8996b00c
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2020 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/type_id.hpp"
namespace
caf
{
type_id
::
type_id
()
{
// nop
}
type_id
::~
type_id
()
{
// nop
}
}
// namespace caf
libcaf_core/test/detail/message_builder_element.cpp
deleted
100644 → 0
View file @
8996b00c
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2020 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#define CAF_SUITE detail.message_builder_element
#include "caf/detail/message_builder_element.hpp"
#include "caf/test/dsl.hpp"
using
namespace
caf
;
namespace
{
struct
fixture
{};
}
// namespace
CAF_TEST_FIXTURE_SCOPE
(
message_builder_element_tests
,
fixture
)
CAF_TEST
(
todo
)
{
// implement me
}
CAF_TEST_FIXTURE_SCOPE_END
()
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