Skip to content

Commit bbb8149

Browse files
committed
v0.9.5
2 parents ccdf83b + 0fbe68a commit bbb8149

25 files changed

+496
-51
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
bin/
77

8-
build/
8+
build*
9+
10+
output*
911

1012
*.user
1113

@@ -17,5 +19,3 @@ myframe/export.h
1719
myframe/config.h
1820
3rd/pkg/
1921
3rd/src/
20-
3rd/build/
21-
output/

3rd/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ ExternalProject_Add(
2323
-DBUILD_SHARED_LIBS=ON
2424
-DCMAKE_BUILD_TYPE=Release
2525
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
26+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
2627
)
2728

2829
ExternalProject_Add(
@@ -42,6 +43,7 @@ ExternalProject_Add(
4243
-DWITH_GTEST=OFF
4344
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
4445
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
46+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
4547
)
4648
ExternalProject_Add_StepDependencies(glog install gflags)
4749

@@ -64,4 +66,5 @@ ExternalProject_Add(
6466
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
6567
-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
6668
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
69+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
6770
)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
22
if (POLICY CMP0091)
33
cmake_policy(SET CMP0091 NEW)
44
endif()
5-
project(myframe VERSION 0.9.4)
5+
project(myframe VERSION 0.9.5)
66

77
### option
88
option(MYFRAME_USE_CV "Using conditional variables for thread communication" ON)

cpplint.bash

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function main() {
1919
-name "*.cxx" -or \
2020
-name "*.cuh" \
2121
')' -and -not -path "./build/*" \
22+
-and -not -path "./output/*" \
23+
-and -not -path "./3rd/*" \
24+
-and -not -path "./myframe/export.h" \
2225
| xargs python3 ./cpplint.py
2326
}
2427

examples/CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,29 @@ add_library(example_trans_obj SHARED example_trans_obj.cpp)
3434
target_link_libraries(example_trans_obj ${PROJECT_NAME})
3535

3636
### install
37-
FILE(GLOB conf_files "*.json")
38-
INSTALL(FILES
37+
file(GLOB conf_files "*.json")
38+
# 在unix like系统下禁用MYFRAME_USE_CV才能用,有需要再打开
39+
list(REMOVE_ITEM conf_files "${CMAKE_CURRENT_SOURCE_DIR}/example_worker_interactive_with_3rd_frame.json")
40+
install(FILES
3941
${conf_files}
4042
PERMISSIONS
4143
OWNER_READ OWNER_WRITE
4244
GROUP_READ
4345
WORLD_READ
4446
DESTINATION ${MYFRAME_SERVICE_DIR}
4547
)
46-
INSTALL(TARGETS
48+
install(TARGETS
4749
example_actor_helloworld
4850
example_actor_timer
4951
example_actor_serial
5052
example_actor_concurrent
5153
example_actor_subscribe
5254
example_node
53-
example_worker_actor_interactive
55+
example_worker_actor_interactive
5456
example_worker_publish
55-
example_worker_talk
56-
example_worker_interactive_with_3rd_frame
57+
example_worker_talk
58+
# 在unix like系统下禁用MYFRAME_USE_CV才能用,有需要再打开
59+
# example_worker_interactive_with_3rd_frame
5760
example_worker_quit
5861
example_config
5962
example_trans_obj

examples/example_config.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class ExampleActorConfig : public myframe::Actor {
1717
int Init(const char* param) override {
1818
(void)param;
1919
auto conf = GetConfig();
20+
LOG(INFO) << GetActorName() << " pending queue size "
21+
<< GetMailbox()->GetPendingQueueSize();
22+
LOG(INFO) << GetActorName() << " run queue size "
23+
<< GetMailbox()->GetRunQueueSize();
2024
LOG(INFO) << GetActorName() << " conf " << conf->toStyledString();
2125
return 0;
2226
}

examples/example_config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
{
77
"instance_name":"#1",
88
"instance_config":{
9+
"pending_queue_size":-1,
10+
"run_queue_size":-1,
911
"key1":"hello",
1012
"key2":"world"
1113
}

launcher/conf/sys.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"default_pending_queue_size":-1,
3+
"default_run_queue_size":-1,
24
"thread_poll_size":4,
35
"conn_event_size":2,
46
"warning_msg_size":10

launcher/launcher.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ int main(int argc, char** argv) {
7777
lib_dir.string(),
7878
module_args.GetThreadPoolSize(),
7979
module_args.GetConnEventSize(),
80-
module_args.GetWarningMsgSize())) {
80+
module_args.GetWarningMsgSize(),
81+
module_args.GetDefaultPendingQueueSize(),
82+
module_args.GetDefaultRunQueueSize())) {
8183
LOG(ERROR) << "Init failed";
8284
return -1;
8385
}

launcher/module_argument.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ bool ModuleArgument::ParseSysConf(const std::string& sys_conf) {
131131
&& root["service_dir"].isString()) {
132132
conf_dir_ = root["service_dir"].asString();
133133
}
134+
if (root.isMember("default_pending_queue_size")
135+
&& root["default_pending_queue_size"].isInt()) {
136+
default_pending_queue_size_ = root["default_pending_queue_size"].asInt();
137+
}
138+
if (root.isMember("default_run_queue_size")
139+
&& root["default_run_queue_size"].isInt()) {
140+
default_run_queue_size_ = root["default_run_queue_size"].asInt();
141+
}
134142
return true;
135143
}
136144

0 commit comments

Comments
 (0)