tencent / pebble Goto Github PK
View Code? Open in Web Editor NEWPebble分布式开发框架
License: Other
Pebble分布式开发框架
License: Other
例如服务A 有一个接口a,在访问A::a时,会rpc调用服务B上的接口b,使用协程应该怎么写呢?
A::a(const ARequest& request, cxx::function<void(int32_t ret_code, const AResponse& response)>& rsp){
BRequest b_req;
BResponse b_resp;
b_client.b(b_req, &b_resp);
AResponse a_resp;
// xxxxxx
rsp(pebble::kRPC_SUCCESS, a_resp);
}
这样会报错
[(src/server/pebble_server.cpp:714)(ProcessMessage)][ERROR] handle(4294967298) not attach a processor remote(4294967298)
[(src/framework/net_message.cpp:766)(RecvTcpData)][ERROR] recv failed(-1:), netaddr=4294967297
Mac上可以编译吗?
编译环境:
腾讯云机器
centos7.2
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
请问能建立一个pebble的交流群吗,出现问题方便及时沟通。谢谢~
编译错误信息:
build64_release/source/rpc/compiler/cpp/src/pebble -r -out build64_release/tutorial/helloworld --gen cpp tutorial/helloworld/helloworld.pebble
cd build64_release/source/rpc;cp ../broadcast/libpebble_broadcast.a .;cp ../../thirdparty/consistent_hash/libconsistent_hash.a .;ar -x libpebble_broadcast.a;ar -x libconsistent_hash.a;ar -x common/libpebble_rpc_common.a;ar -x protocol/libpebble_rpc_protocol.a;ar -x transport/libpebble_rpc_transport.a;ar -x libpebble_rpc.a;ar -rcs libpebble_rpc_s.a *.o;rm *.o;rm libpebble_broadcast.a;rm libconsistent_hash.a
cp: cannot stat '../../thirdparty/consistent_hash/libconsistent_hash.a': No such file or directory
ar: libconsistent_hash.a: No such file or directory
rm: cannot remove 'libconsistent_hash.a': No such file or directory
scons: *** [build64_release/source/rpc/libpebble_rpc_s.a] Error 1
scons: building terminated because of errors.
Blade(error): building failure
cd build64_release/source/rpc;cp ../broadcast/libpebble_broadcast.a .;cp ../../thirdparty/consistent_hash/libconsistent_hash.a .;ar -x libpebble_broadcast.a;ar -x libconsistent_hash.a;ar -x common/libpebble_rpc_common.a;ar -x protocol/libpebble_rpc_protocol.a;ar -x transport/libpebble_rpc_transport.a;ar -x libpebble_rpc.a;ar -rcs libpebble_rpc_s.a *.o;rm *.o;rm libpebble_broadcast.a;rm libconsistent_hash.a
build64_release/source/rpc/compiler/cpp/src/pebble -r -out build64_release/tutorial/helloworld --gen cpp tutorial/helloworld/helloworld.pebble
Compiling build64_release/tutorial/broadcast/idl/broadcast_tutorial_BroadcastTrigger.cpp
cp: cannot stat '../../thirdparty/consistent_hash/libconsistent_hash.a': No such file or directory
ar: libconsistent_hash.a: No such file or directory
rm: cannot remove 'libconsistent_hash.a': No such file or directory
缺少库啊,编译错误
另外
source/rpc/transport/buffer_transport.h里ptrdiff_t也缺少std声明,我这里都要手动改代码才能编译通过
我看了项目中的broadcastMgr,是采用的订阅者的模式,服务器采用循环TCP发送的方式,向订阅者发送订阅数据;
那么可否实现,一条数据只向订阅组发送一次,达到所有订阅者都能接收到的方式;类似UDP broadcast一样;如果这种方式实现的话,是否会优于目前的方式?如果没有好处,那么原因是什么呢?
I failed to compile the project in an ubuntu 16.04 docker following the guideline. The following solution worked for me.
apt-get install libreadline-dev && chmod 775 /root/bin/blade
example/threadpool/BUILD
. Change '#pthread'
'//src/common/:pebble_common',
to
'//src/common/:pebble_common',
'#pthread'
ldconfig
tools/compiler/pb/BUILD
. Change deps = [
'//src/common:pebble_common',
'//thirdparty/protobuf:protoc',
]
to
deps = [
'#protoc',
'#protobuf',
'//src/common:pebble_common',
]
Now it compiles.
Blade(warning): Auto upgrade failure: /root/bin/blade: line 75: svn: command not found
Blade(warning): Please svn up /mnt/git_project/Pebble/tools/blade
Blade(warning): You can setenv BLADE_AUTO_UPGRADE=no to disable auto upgrade
Blade(info): loading BUILDs...
Blade(info): loading done.
Blade(info): analyzing dependency graph...
Blade(info): analyzing done.
Blade(info): generating build rules...
sh: 1: svn: not found
Blade(info): CPP=cpp
Blade(info): CC=gcc
Blade(info): CXX=g++
Blade(info): NVCC=nvcc
Blade(info): LD=g++
Blade(info): generating done.
Blade(info): tunes the parallel jobs number(-j N) to be 2
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build64_release
Updating version information
Compiling source/rpc/compiler/cpp/src/main.cc
Compiling source/rpc/compiler/cpp/src/thrifty.cc
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
scons: *** [build64_release/source/rpc/compiler/cpp/src/pebble.objs/main.cc.o] Error 4
thrifty.yy:28:0: warning: "__STDC_LIMIT_MACROS" redefined [enabled by default]
:0:0: note: this is the location of the previous definition
thrifty.yy:29:0: warning: "__STDC_FORMAT_MACROS" redefined [enabled by default]
:0:0: note: this is the location of the previous definition
{standard input}: Assembler messages:
{standard input}:5661: Warning: end of file not at end of a line; newline inserted
{standard input}:6328: Error: unknown pseudo-op: `.lvl5'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
scons: *** [build64_release/source/rpc/compiler/cpp/src/pebble.objs/thrifty.cc.o] Error 4
scons: building terminated because of errors.
Blade(error): building failure
请问这个是什么问题
看了example下的例子,有几点使用上的疑惑
|<--->serviceA
player<->gateway<--->|<--->serviceB
|<--->serviceC
文件src/common/coroutine.cpp 中定义数组
static stCoRoutineEnv_t* g_arrCoEnvPerThread[102400] = {0};
在函数coroutine_open()中直接使用pid作为下标,有可能导致数组下标越界错误。
虽然进程pid小于102400的概率比较小,但我确实遇到了。
如题
能留个联系方式么,或建个QQ群来讨论pebble, pebble rpc 规则文档都木有上传!!!!我的QQ445267987
请问,这是一个稳定的产品,可以用来商业性质的游戏服务端开发吗?
build64_release/src/common/libpebble_common.a(thread.cpp.o): In function pebble::Thread::Start()': /home/Pebble-master/src/common/thread.cpp:34: undefined reference to
pthread_create'
source/app/control_command.cpp是否缺少头文件
'source/app/idl/control_service_ControlCommand_if.h' file not found
Blade(warning): Auto upgrade failure: 跳过“tools/blade”
svn: E155007: None of the targets are working copies
Blade(warning): Please svn up /home/Test/文档/Pebble-master/tools/blade
Blade(warning): You can setenv BLADE_AUTO_UPGRADE=no to disable auto upgrade
Blade(warning): unknown source client type, NOT svn OR git
Blade(info): loading BUILDs...
Blade(error): //./BUILD not found, exit...
cc1plus: error: deps/tsf4g/include: No such file or directory [-Werror=missing-include-dirs]
少了tf4g的库
\tools\compiler\dr\src\generate../../version.h(14): fatal error C1083: 无法打开包括文件: “pebble_version.inh”
我编译protobuf_rpc时,链接报undefined reference错误,具体如下:
Compiling tools/compiler/pb/src/cpp_plugin.cpp
Linking Program build64_release/tools/compiler/pb/protobuf_rpc
build64_release/tools/compiler/pb/protobuf_rpc.objs/src/cpp_plugin.cpp.o: In function `pebble::ProtoBufPrinter::Print(std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, char const*)':
/home/jeffxie/work/c++/Pebble/tools/compiler/pb/src/cpp_plugin.cpp:112: undefined reference to `google::protobuf::io::Printer::Print(std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::less<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > > const&, char const*)'
build64_release/tools/compiler/pb/protobuf_rpc.objs/src/cpp_plugin.cpp.o: In function `pebble::ProtoBufPrinter::ProtoBufPrinter(std::__cxx11::basic_string<char, std::char_traits, std::allocator >*)':
/home/jeffxie/work/c++/Pebble/tools/compiler/pb/src/cpp_plugin.cpp:109: undefined reference to `google::protobuf::io::StringOutputStream::StringOutputStream(std::__cxx11::basic_string<char, std::char_traits, std::allocator >*)'
collect2: error: ld returned 1 exit status
scons: *** [build64_release/tools/compiler/pb/protobuf_rpc] Error 1
scons: building terminated because of errors.
Blade(error): building failure
是不是thirdparty/protobuf/lib64_release没有提供最新的库导致?请大神们指点!谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.