MqContextC - create and manage a service … More...
MqContextC - create and manage a service …
To provide a service is the main purpose of a server and the main-purpose of a client/server connection is to call a service and to process the result.
A service can be defined on the server or on the client. On the server a service can be initial setup with MqServerSetupIF method and finally cleanup with MqServerCleanupIF.
A service is created with the MqServiceCreate and deleted with the MqServiceDelete.
A service can be created and deleted during the entire life-cycle of the server or the client. If the server/client-context is deleted all services of the are deleted also.
A MqServiceDelete is not required.
Creating or deleting a service is like granting or revoking the right to access a single feature.
eventloop
callback
Example from MyServer.cc
→ define the service SRV1 on the server-link-setup
#include "LibMqMsgque_cc.hh" using namespace ccmqmsgque; // package-item class MyServer : public MqContextC, public MqServerSetupIF { friend class MqFactoryCT<MyServer>; private: // define the factory constructor MyServer(MK_TYP const typ, MqContextC* tmpl=NULL) : MqContextC(typ,tmpl) {}; private: // service to serve all incoming requests for token "HLWO" void MyFirstService () { SendSTART(); SendV("%s World", ReadSTR()); SendRETURN(); } // define a service as link between the token "HLWO" and the callback "MyFirstService" void ServerSetup() { ServiceCreate("HLWO", MqServiceICB(&MyServer::MyFirstService)); } }; // package-main int MK_CDECL main(int argc, MK_STRN argv[]) { MqMsgque::Setup(); // setup commandline arguments for later use MkBufferListC largs = {argc, argv}; // create "MyServer" factory… and make it to the default. MqFactoryCT<MyServer>::Add("MyServer")->Default(); // inspect commandline-argument for the "factory" to choose… and create a object auto srv = MqFactoryCT<MqContextC>::GetCalled(largs)->New(); // start listen for incoming call's try { srv->LinkCreate(largs); srv->ProcessEvent (MQ_WAIT_FOREVER); } catch (const std::exception& e) { srv->ErrorCatch(e); } srv->Exit(); }
To provide a service is the main purpose of a server and the main-purpose of a client/server connection is to call a service and to process the result.
A service can be defined on the server or on the client. On the server a service can be initial setup with MqServerSetupIF method and finally cleanup with MqServerCleanupIF.
A service is created with the MqServiceCreate and deleted with the MqServiceDelete.
A service can be created and deleted during the entire life-cycle of the server or the client. If the server/client-context is deleted all services of the are deleted also.
A MqServiceDelete is not required.
Creating or deleting a service is like granting or revoking the right to access a single feature.
eventloop
callback
Example from MyServer.cc
→ define the service SRV1 on the server-link-setup
#include "LibMqMsgque_cc.hh" using namespace ccmqmsgque; // package-item class MyServer : public MqContextC, public MqServerSetupIF { friend class MqFactoryCT<MyServer>; private: // define the factory constructor MyServer(MK_TYP const typ, MqContextC* tmpl=NULL) : MqContextC(typ,tmpl) {}; private: // service to serve all incoming requests for token "HLWO" void MyFirstService () { SendSTART(); SendV("%s World", ReadSTR()); SendRETURN(); } // define a service as link between the token "HLWO" and the callback "MyFirstService" void ServerSetup() { ServiceCreate("HLWO", MqServiceICB(&MyServer::MyFirstService)); } }; // package-main int MK_CDECL main(int argc, MK_STRN argv[]) { MqMsgque::Setup(); // setup commandline arguments for later use MkBufferListC largs = {argc, argv}; // create "MyServer" factory… and make it to the default. MqFactoryCT<MyServer>::Add("MyServer")->Default(); // inspect commandline-argument for the "factory" to choose… and create a object auto srv = MqFactoryCT<MqContextC>::GetCalled(largs)->New(); // start listen for incoming call's try { srv->LinkCreate(largs); srv->ProcessEvent (MQ_WAIT_FOREVER); } catch (const std::exception& e) { srv->ErrorCatch(e); } srv->Exit(); }
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2108 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2127 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2146 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2099 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2118 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceCreate(MQ_TOK token, MqServiceICB MqServiceCCB MqServiceIF* callback)
create a link between a service-token and a service-callback …
Definition at line 2137 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceDelete(MQ_TOK token)
delete a service. …
Definition at line 2164 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceDelete(MQ_TOK token)
delete a service. …
Definition at line 2156 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceIsTransaction()
check if the ongoing-service-call belongs to a transaction …
Definition at line 2173 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxy(MQ_TOK token, MQ_SLAVE_ID id = MQ_SLAVE_OTHER)
create a service to link a master-context with a slave-context. …
Definition at line 2189 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxy(MQ_TOK token, MQ_SLAVE_ID id = MQ_SLAVE_OTHER)
create a service to link a master-context with a slave-context. …
Definition at line 2181 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxyCtx(MQ_TOK token, MqContextC* target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 2226 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxyCtx(MQ_TOK token, MqContextC* target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 2216 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxyCtx(MQ_TOK token, MqContextC* target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 2207 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxyCtx(MQ_TOK token, MqContextC* target)
same as MqServiceProxy but use an MqContextC as input.
Definition at line 2198 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceProxyCtxExists(MQ_TOK token, MqContextC* target)
check if service who belongs to token is a proxy-service
Definition at line 2264 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceProxyCtxExists(MQ_TOK token, MqContextC* target)
check if service who belongs to token is a proxy-service
Definition at line 2254 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceProxyCtxExists(MQ_TOK token, MqContextC* target)
check if service who belongs to token is a proxy-service
Definition at line 2245 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceProxyCtxExists(MQ_TOK token, MqContextC* target)
check if service who belongs to token is a proxy-service
Definition at line 2236 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceProxyRoundRobin(MQ_TOK token, MK_STRN ident)
create a proxy-service using Round-Robin as load-balancer …
Definition at line 2282 of file MqContextC_inline_cc.hh.
C++:
→ C-API ctx.ServiceProxyRoundRobin(MQ_TOK token, MK_STRN ident)
create a proxy-service using Round-Robin as load-balancer …
Definition at line 2274 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceStorage(MQ_TOK token)
setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE …
Definition at line 2300 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API ctx.ServiceStorage(MQ_TOK token)
setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE …
Definition at line 2292 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceTokenCheck(MQ_TOK token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
Definition at line 2317 of file MqContextC_inline_cc.hh.
C++:
→ C-API MK_BOOL ctx.ServiceTokenCheck(MQ_TOK token)
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
Definition at line 2309 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MK_BOOL ctx.ServiceTokenExists(MQ_TOK token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
Definition at line 2334 of file MqContextC_inline_cc.hh.
C++:
→ C-API MK_BOOL ctx.ServiceTokenExists(MQ_TOK token)
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
Definition at line 2326 of file MqContextC_inline_cc.hh.
|
inline |
C++:
→ C-API MQ_TOK ctx.ServiceTokenGet()
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …
Definition at line 2343 of file MqContextC_inline_cc.hh.