Commit 41659042 authored by tufengqi's avatar tufengqi

service factory兼容swoft

parent 0b32a3ca
...@@ -4,25 +4,13 @@ namespace fpf\thrift; ...@@ -4,25 +4,13 @@ namespace fpf\thrift;
class ThriftServiceFactory class ThriftServiceFactory
{ {
private static $sync_services = [];
private static $async_services = [];
public static function getService($class_name) public static function getService($class_name)
{ {
if (!empty(self::$sync_services[$class_name])) { return new ThriftServiceFactoryProxy($class_name);
return self::$sync_services[$class_name];
}
self::$sync_services[$class_name] = new ThriftServiceFactoryProxy($class_name);
return self::$sync_services[$class_name];
} }
public static function getAsyncService($class_name) public static function getAsyncService($class_name)
{ {
if (!empty(self::$async_services[$class_name])) { return new ThriftAsyncServiceFactoryProxy($class_name);
return self::$async_services[$class_name];
}
self::$async_services[$class_name] = new ThriftAsyncServiceFactoryProxy($class_name);
return self::$async_services[$class_name];
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment