Commit Graph

27 Commits

Author SHA1 Message Date
Alex Roitman b55300b729 Lua scripting feature. (#224)
* Start on lua scripting

* Implement evalsha, script load, script exists, and script flush

* Type conversions from lua to resp/json.
Refactor to make luastate and luascripts persistent in the controller.

* Change controller.command and all underlying commands to return resp.Value.
Serialize only during the ouput.

* First stab at tile38 call from lua

* Change tile38 into tile38.call in Lua

* Property return errors from scripts

* Minor refactoring.  No locking on script run

* Cleanup/refactoring

* Create a pool of 5 lua states, allow for more as needed. Refactor.

* Use safe map for scripts.  Add a limit for max number of lua states.  Refactor.

* Refactor

* Refactor script commands into atomic, read-only, and non-atomic classes.
Proper locking for all three classes.
Add tests for scripts

* More tests for scripts

* Properly escape newlines in lua-produced errors

* Better test for readonly failure

* Correctly convert ok/err messages between lua and resp.
Add pcall, sha1hex, error_reply, status_reply functions to tile38 namespace in lua.

* Add pcall test. Change writeErr to work with string argument

* Make sure eval/evalsha never attempt to write AOF

* Add eval-set and eval-get to benchmarks

* Fix eval benchmark tests, add more

* Improve benchmarks

* Optimizations and refactoring.

* Add lua memtest

* Typo

* Add dependency

* golint fixes

* gofmt fixes

* Add scripting commands to the core/commands.json

* Use ARGV for args inside lua
2017-10-05 08:20:40 -07:00
Josh Baker 300635727a apply LIMIT after WHERE clause, fix #199 2017-07-24 08:26:48 -07:00
Josh Baker d88f4594ac distances on geofence, fixes #141 2017-02-24 06:25:50 -07:00
Josh Baker 374d199d07 detect inside on enter, fixes #150 2017-02-24 06:03:11 -07:00
Josh Baker 033d0d333e redundant condition 2017-02-12 07:06:56 -07:00
mike kabischev 237d4b2284 fix #143 broken hook data 2017-02-08 14:16:54 +03:00
w1n2k 1b20a4c590 Added distance to NEARBY command 2017-01-10 19:49:48 +03:00
Josh Baker bafb1823b3 Metadata for Webhooks
Added the `META name value` keyword to the SETHOOK command.

Allows for adding metadata to a webhook. For example:

    SETHOOK myhook http://endpoint/ META m1 12 META m2 13 NEARBY ...

Would result in notification that contain the "meta" element, which is
represented like:

    "meta":{"m1":"12","m2":"13"}

Thanks for the suggestion @amorskoy

closed #105
2016-12-29 08:50:54 -07:00
Josh Baker 3e3d364911 test app for #107 2016-12-28 11:16:28 -07:00
Josh Baker ef74a63c79 Add SCAN to Roaming Geofences
Can now get back more details about an object:

     NEARBY people FENCE ROAM people * 5000 SCAN :*

For more information see #96

Thanks @amorskoy for suggesting feature in #93

Closes #96
2016-12-15 11:37:38 -07:00
Josh Baker 6c52f3f3f1 added command filter for geofences
It's now possible to mask the fence notifications based on the
command. For example, if we only want "set" and "del" commands.

NEARBY fleet FENCE COMMANDS set,del POINT 33 -115 10000

Suggested by @amorskoy, closes #99
2016-12-15 10:00:08 -07:00
Josh Baker 3a483e55ff Group geofence events
Feature request by @huangpeizhi #87
2016-12-06 10:30:48 -07:00
Josh Baker 76ce0e58b2 fix #84, roaming fence deadlock 2016-11-17 09:04:31 -07:00
Josh Baker c425d76374 Z optimized, fixed #61 2016-10-03 13:03:20 -07:00
Josh Baker 75adea6a9c scan order asc/desc 2016-07-12 13:18:16 -06:00
Josh Baker fbe19564b9 added string type 2016-07-10 13:23:50 -07:00
Josh Baker afa15461de fixed json syntax error 2016-05-23 13:40:08 -07:00
Josh Baker 8fdc35af61 roaming fence 2016-05-23 13:01:42 -07:00
Josh Baker 6b9468d01b lint cleanup 2016-04-02 19:16:36 -07:00
Josh Baker 5dd69b64b3 ineffassign97 2016-04-02 18:34:11 -07:00
Josh Baker 6eb21b890c fixed shared string issue 2016-04-02 14:13:20 -07:00
Josh Baker a3725c7a2a async hooks 2016-04-02 07:20:30 -07:00
Josh Baker cdc2bbee73 fence detect option 2016-04-01 12:46:39 -07:00
Josh Baker 7f9b9b8abb fence updates 2016-03-30 09:32:38 -07:00
Fabian Aussems a44c3a6d67 Missing quotes make tile38 output invalid json 2016-03-24 16:18:18 +01:00
Josh Baker 464d4eb4ed http hook & shrink 2016-03-19 18:31:59 -07:00
Josh Baker bbb29b9349 isolated fence method 2016-03-19 07:16:19 -07:00