User Tools

Site Tools


sib:callers:mysqlcaller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sib:callers:mysqlcaller [2019/06/12 06:50]
ozzy
sib:callers:mysqlcaller [2019/10/02 08:26] (current)
hubbe
Line 11: Line 11:
  
 |Module|sib_mysqlcaller| |Module|sib_mysqlcaller|
-|Version|1.3.5|+|Version|1.3.6|
  
 ==== Workflow ==== ==== Workflow ====
Line 31: Line 31:
  _id: "​mySQLSample:​1",​  _id: "​mySQLSample:​1",​
  _name: "​MySQLCallerSample",​  _name: "​MySQLCallerSample",​
 + init: ( thisCaller )=>{},
  inputFormat:​ (topic, msg, cb, mysqlConnection)=>​{  inputFormat:​ (topic, msg, cb, mysqlConnection)=>​{
  msg.sql = "​INSERT INTO test (test, num) VALUES ('​a',​1),​ ('​b',​2)";​  msg.sql = "​INSERT INTO test (test, num) VALUES ('​a',​1),​ ('​b',​2)";​
Line 61: Line 62:
   * _id: The unique ID of this service   * _id: The unique ID of this service
   * _name: A plaintext description of this service   * _name: A plaintext description of this service
 +  * init(thisCaller):​ If defined this method is executed when the service is starting up as the last step of initialization. //​thisCaller//​ is a reference to the instance of the caller that does the method call.
   * inputFormat(topic,​ msg, callback, mysqlConnection):​ The method that is run on service activation. The original message is passed as the argument and the input value to the callback must be a JSON formatted message conforming to the SIB message standard. As of version 1.3.2 the mySQLCallers mysql connection is passed to the inputFormat. If msg.result is set in the returned message no further database actions will be taken by the caller.   * inputFormat(topic,​ msg, callback, mysqlConnection):​ The method that is run on service activation. The original message is passed as the argument and the input value to the callback must be a JSON formatted message conforming to the SIB message standard. As of version 1.3.2 the mySQLCallers mysql connection is passed to the inputFormat. If msg.result is set in the returned message no further database actions will be taken by the caller.
   * loggerCfg: A JSON Object defining what logger actions should be active for this service (see [[sib:​loggerConfiguraton|Logger Configuration]]   * loggerCfg: A JSON Object defining what logger actions should be active for this service (see [[sib:​loggerConfiguraton|Logger Configuration]]
sib/callers/mysqlcaller.1560322215.txt.gz ยท Last modified: 2019/06/12 06:50 by ozzy