example of calling a service (plugin) from client (c++)

23 views
Skip to first unread message

Andrey Karpov

unread,
Feb 6, 2015, 10:48:01 AM2/6/15
to rever...@googlegroups.com
can you explain me please how to properly write own realisation of a cocaine::framework::service_t like that? https://github.com/cocaine/cocaine-framework-native/blob/v0.11/include/cocaine/framework/services/storage.hpp

my goal is writing yet another service for cocaine_runtime and now  the question arises how to calling my service from client side. what is a best way in v11?

Продублирую на великом и могучем вопрос, а то англицкий корявый. :)
Есть собственный сервис(плагин), который устанавливается и отлично работает в cocaine_runtime. Теперь хочется подёргать его из плюсового клиента, но непонятно как это сделать лучше в реалиях v11. Пытаюсь осознать можно ли сделать в таком виде: https://github.com/cocaine/cocaine-framework-native/blob/v0.11/include/cocaine/framework/services/storage.hpp
,но непонятно что делать в месте вызова call, ведь надо как-то указать что именно дёргать(какой метод, какой сервис): 

Andrey Sibiryov

unread,
Feb 7, 2015, 10:58:37 AM2/7/15
to rever...@googlegroups.com

Essentially, you invoke call method template of the service_t base class by providing a messagetype and message arguments:

call<cocaine::io::storage::read>(collection, key);

In this example, cocaine::io::storage::read is the message type from cocaine/messages.hpp — https://github.com/cocaine/cocaine-core/blob/v0.11/include/cocaine/messages.hpp#L291, in v0.11 branch this file defines all interfaces for builtin services.


Here's the Issue for this topic on GH: https://github.com/cocaine/cocaine-framework-native/issues/16

Reply all
Reply to author
Forward
0 new messages