theLink 10.0 NHI1 - theKernel - theLink - theConfig - theSq3Lite - theCompiler - theBrain - theGuard
c - tcl - cs - py - rb - jv - cc
Loading...
Searching...
No Matches
MqContextC_Env_PY_API

MqContextC - protect and restore the service-environment … More...

+ Collaboration diagram for MqContextC_Env_PY_API:

Functions

static OT_ProcRet pymqmsgque_MqContextC_EnvProtect (MqContextC_ARGS)
  Python: ctx.EnvProtect() C-API
protect the service-environment
 
static OT_ProcRet pymqmsgque_MqContextC_EnvRestore (MqContextC_ARGS)
  Python: ctx.EnvRestore() C-API
restore the service-environment
 

Detailed Description

MqContextC - protect and restore the service-environment …

The "Env" style functions are used to secure the service-environment (defined in MqEnvS)
and is required.. under special conditions... to proper answer the original service call at the
end of the service-processing.
By default pymqmsgque guarantee the proper management of the environment on behalf of the user.
Under normal conditions the user don't need these functions.

The folllowing design-goals were defined:

The two design-goals from above are in conflict and the both functions MqEnvProtect and MqEnvRestore are used to solve this conflict.

Example from server.py protect the environment and import from database

      # PROTECT the original service-call
      self.EnvProtect()
      # OVERWRITE the original service-call with data from the database
      self.dump.Import(self)
      read = self.ReadALL()
      # RESTORE the original service-call
      self.EnvRestore()
      # ANSWER the original service-call
      self.Send("R", "L", read);

Function Documentation

◆ pymqmsgque_MqContextC_EnvProtect()

static OT_ProcRet pymqmsgque_MqContextC_EnvProtect ( MqContextC_ARGS )
static

Python: ctx.EnvProtect() C-API
protect the service-environment

Definition at line 1342 of file MqContextC_py.c.

1342 {
1344 OT_SETUP_NOARG(EnvProtect_doc)
1345 OT_CHECK_NOARGS
1346 MqEnvProtect (hdl);
1347 OT_retObj_SET_None
1348 goto end;
1349 error:
1350 OT_retObj_SET_Error
1351 end:
1353}
#define OT_SETUP_hdl
#define EnvProtect_doc
#define OT_retObj_RETURN
#define error
#define MqEnvProtect(...)

◆ pymqmsgque_MqContextC_EnvRestore()

static OT_ProcRet pymqmsgque_MqContextC_EnvRestore ( MqContextC_ARGS )
static

Python: ctx.EnvRestore() C-API
restore the service-environment

Definition at line 1356 of file MqContextC_py.c.

1356 {
1358 OT_SETUP_NOARG(EnvRestore_doc)
1359 OT_CHECK_NOARGS
1360 MqEnvRestore (hdl);
1361 OT_retObj_SET_None
1362 goto end;
1363 error:
1364 OT_retObj_SET_Error
1365 end:
1367}
#define EnvRestore_doc
void MqEnvRestore(MQ_CTX ctx)
restore the service-environment