Example #1
0
 /**
  * @return APF_AMQP_Factory
  */
 public static function &get_instance()
 {
     if (!self::$instance) {
         self::$instance = new MPF_Amqp_Factory();
     }
     return self::$instance;
 }
Example #2
0
 public function delete()
 {
     if ($this->is_loaded == false) {
         return false;
     }
     try {
         $msg = $this->build_delete();
         $con = MPF_AMQP_Factory::get_instance()->get_connection();
         $ex = new AMQPExchange($con, self::get_exchange());
         $ex->publish($msg, self::get_routing());
     } catch (Exception $e) {
         MPF::get_instance()->get_debugger()->debug('AMPQ: Can not be published - ' . $e->getMessage());
     }
     return true;
 }