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.atl
→ define the service HLWO on the server-link-setup
package require lib_85 package require atlmqmsgque # package-item ::myooX::ClassN ::MyServer { SuperI ::MqContextC # service to serve all incoming requests for token "HLWO" proc myFirstService {myNs} { SendSTART $myNs SendSTR $myNs "[ReadSTR $myNs] World" SendRETURN $myNs } # define a service as link between the token "HLWO" and the callback "MyFirstService" proc serverSetup {myNs} { ServiceCreate $myNs "HLWO" myFirstService } # factory startup (constructor) proc MyServer {myNs {tmpl ""}} { MqContextC $myNs $tmpl ConfigSetServerSetup $myNs serverSetup } } # package-main MqMsgque::Main { # setup commandline arguments for later use set args [MkBufferListC::CreateLA {*}$argv] # create "MyServer" factory... and make it to the default. set fct [MqFactoryC::Default [MqFactoryC::Add ::MyServer]] # inspect commandline-argument for the "factory" to choose... and create a object set fct [MqFactoryC::GetCalledL $args] set srv [MqFactoryC::New $fct] try { MqContextC::LinkCreate $srv $args MqContextC::ProcessEvent $srv MQ_WAIT_FOREVER } on error {} { MqContextC::ErrorCatch $srv } finally { MqContextC::Exit $srv } }
|
static |
Atl:
→ C-API MqContextC::ServiceCreate $ctx token:string[4] callback:callable
create a link between a service-token and a service-callback …
Definition at line 3043 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API MqContextC::ServiceDelete $ctx token:string[4]
delete a service. …
Definition at line 3062 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API bool [MqContextC::ServiceIsTransaction $ctx]
check if the ongoing-service-call belongs to a transaction …
Definition at line 3078 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API MqContextC::ServiceProxy $ctx token:string[4] ?id:MqSlaveE|int32=MQ_SLAVE_OTHER?
create a service to link a master-context with a slave-context. …
Definition at line 3091 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API MqContextC::ServiceProxyCtx $ctx token:string[4] target:MqContextC
same as MqServiceProxy but use an MqContextC as input.
Definition at line 3109 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API bool [MqContextC::ServiceProxyCtxExists $ctx token:string[4] target:MqContextC]
check if service who belongs to token is a proxy-service
Definition at line 3127 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API MqContextC::ServiceProxyRoundRobin $ctx token:string[4] ident:string
create a proxy-service using Round-Robin as load-balancer …
Definition at line 3144 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API MqContextC::ServiceStorage $ctx token:string[4]
setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE …
Definition at line 3162 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API bool [MqContextC::ServiceTokenCheck $ctx token:string[4]]
in an ongoing-service-call check if the current MqContextC_ServiceApi_Identifer is token …
Definition at line 3178 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API bool [MqContextC::ServiceTokenExists $ctx token:string[4]]
check if the MqContextC_ServiceApi_Identifer token is defined as ctx service …
Definition at line 3193 of file MqContextC_atl.c.
|
static |
Atl:
→ C-API string[4] [MqContextC::ServiceTokenGet $ctx]
in an ongoing-service-call get the current MqContextC_ServiceApi_Identifer …
Definition at line 3208 of file MqContextC_atl.c.