- A new platform setting `ENABLE_CONTEXT_FEATURES` is added, to be used in servers, so each context use its own thread pool, the default pool is disabled. Platform like OpenResty should turn on it, and the `MULTI_OS_THREAD` setting is no need to be used by OpenResty.
- The `TemplateString` system is added in System.Text, it provided a new string generator.
- The `PLOOP_PLATFORM_SETTINGS.DATA_CACHE_USE_FAKE_ENTITY` setting is added, so the data cache system will use fake cahe value to avoid cache penetration automatically, default true.
- The `PLOOP_PLATFORM_SETTINGS.DATA_CACHE_FAKE_ENTITY_TIMEOUT` setting is added, it's the timeout for the fake values of the data cache, default 3600(second).
- The `__BaseIndex__` attribute is added for enum, it works like `__BaseIndex__(100) enum "Test" { A = 1, B = 2 }`, the base value will be added to the enum values, so `Test.A` will be 101, the enum value is limited to [1-99] based on the zero numbers of the base value.
### Changed
- The `__Arguments__` will drop the overload information when the type is sealed to reduce the memory usage.
- A few changes is applied to reduce the memory usage of classes.
- The anonymous array & hash struct type with only type settings like `struct { Number }` and `struct { [String] = Number }` will be auto sealed and unique, so the system won't generate multi struct types for the same types.
- The `lshift,rshift,band,bor,bnot,bxor` api is added in the `System.Toolset`, they are generated based on the platform.
- Fix The `__AutoCache__` attribute for multi thread platform, the result may only be cached when the code processe in the same context and the debug.getgetlocal API is provided.
- The `__AutoCache__` attribute can be used on method or functions, so the results will be cached for arguments, the func will return the cached value with the same arguments.
- Fix the problem when provide the return value in an iterator, the next iterator share the same coroutine will trigger error.
- Remove the ServerRedirect from the HttpResponse, since it may be used to terminate the process like in the Openresty, it's done within the framework, so no code should be modified in the projects.
- If use the `System.__Recycable__` mark the classes, the class can collect disposed objects in the `__dtor` method, can re use them by the `__new` method, since they all disposed, they should be used as new object and passed to the `__ctor` method.
-`USE_THIS_FOR_OBJECT_METHODS` platform setting is added, used to make sure the overload object method can use `this(self, ...)` to call the other implementions of the same method, default false(normall you can call the target method directly like `Method(self, ...)`)
- The `UseThis` method is added to the `__Arguments__` attribtue, so we can use `this` keyword in object method like `__Arguments__{...}:UseThis()`
-`System.Collections.Queue` is added
- Now can use `interface (target) (function(_ENV) ... end)` or `class (target) (function(_ENV) ... end)` to define object or static methods for sealed types, can only be used to define un-existed methods, no keywords can be used.
- System.Reactive lib is added.
### Changed
- Fix the class method extension, object method with the same name of the static method should works now.
-`ToXList` method is added to the `System.Collections.IList`, so we can save the link operations to the XList object and start the new link operations.
-`ToXDict` method is added to the `System.Collections.IDictionary`, so we can save the link operations to the XDictionary and start the new link operations.
-`SafeThreadCall` is added to the `System.Threading.ThreadPool`, it works like the ThreadCall, but only use a new coroutine if the caller isn't in a coroutine, also using `__Async__(true)` will wrap the target function by the `SafeThreadCall`.
-`GetSubTypes` Method is added to `System.Class` and `System.Interface`, will return an iterator to get all sub types directly extend or inherit the target interface or class.
- The System.Data.DataEntityCache can use cache class(extend System.Data.ICache) as its second template parameter, so it can create cache object directly, works like `System.Data.DataCollection[{MyDataContext, NgxLua.Redis }]`
- The `System.__Recyclable__` attribtue is added for classes, so their objects are recylable, the system won't wipe them when Dispose them, and the *Disposed* field won't be set to true since we need to re-use them. The recycle part must be done by the classes themselves.
- The prototype.lua keeps using no old style to avoid some problem caused by the environment changing, there is no need to keep using the old definition style.
- The queue and final method system added for System.Data.DataCollection, only suppor on data entity query, so we can use codes like `ctx.Users:Where("Telno like '%s'", telno):OrderBy("id"):Limit(10):Offset(30):Query()`, the query key in Where and OrderBy could be the data entity property, it'll be changed to the real field name.
- System.Data.DataCollection.Query method changed, can no longer be used to process sql directly, we can use `ctx.Users:Where("id in (%s)", {1, 2, 3, 4}):OrderBy{ "id" }:Query()`, the Lock method is also changed.
- Fix the inner request, it won't use the http method from the raw quest if the params is specific.
- The default template system in the web, can use tables as params for inner request or embed pages like `@[~/test { id = 1}]`, no need use the parentheses.
- The System.Web.HttpSession have a new property "Context" used to get the context where it's generated.
- Fix the spell error for method "TrySetItems" of System.Web.ICacheSessionStorageProvider.
- Struct.GetErrorMessage will only have one return value now, others are discarded.
- Fix the System.Web.__Form__ can't validate single value for array types.
- Send the Json data in an inner request will just return the json data to where the `context:ProcessInnerRequest(...)` is called, the system won't try to serialize and output it.
- The inner request will use the raw request's http method if not specific, also will use the raw request's querystring or form if not specific.
- The System.Web.ParseString will also convert the Lua table(object) values to json format string, so we can use the lua table in the template directly.
- Fix the System.Web.JsonFormatProvider fail to parse 1-byte json data.
- The System.Data.Cache add an abstract method: TrySet, used to try add a key value pair when the key not existed, this is used to replace the Exist-Set operation so used to make sure the operation is thread-safe.
- dictionary struct type can be created like `struct { [String] = Number }`, used to specific the type of the keys and values
- Struct.GetDictionaryKey & Struct.GetDictionaryValue added to fetch the types of the dict struct types
- IDictionary.ToDict method added, used to save the key-value pairs to a new dictionary
### Changed
- System.Serialization added support to the dict struct type, the key must be serializable custom struct type and the value type must be serializable, but nothing stop you convert them to **Dictionary** for serialization.
-`System.Web.__Form__` will refuse to use dict struct type.
- System.Web.JsonFormatProvider added check on member or dict struct type, so it won't check all elements to find out the value is an array.