Add ability to store variables inside redis server database #18

Open
opened 2022-05-06 01:48:13 +00:00 by TheSkyIsCrying · 5 comments

In sklib it was possible for redis variables to be updated for servers even if they're offline but sklib isn't updated anymore and it has a few issues. Is there a way to do it with this addon and if not can you please add an option in the config file?

In sklib it was possible for redis variables to be updated for servers even if they're offline but sklib isn't updated anymore and it has a few issues. Is there a way to do it with this addon and if not can you please add an option in the config file?
Owner

you can do it by saving variables instead of sending them until the server comes online, with your own server online detection code. I am not aware of any easy way to add this feature, as this add-on does not work based on servers, it works based on redis channels, which are always available as long as redis server is online.

you can do it by saving variables instead of sending them until the server comes online, with your own server online detection code. I am not aware of any easy way to add this feature, as this add-on does not work based on servers, it works based on redis channels, which are always available as long as redis server is online.
Owner

I have looked into sklib source code and it seems to be setting redis variables, not Skript variables. RediSkript only uses redis messaging functionality to transmit skript variables, it does not save them on the redis server

so sklib isn't saving variables on the server, it does connection to redis server to get a variable when requested

to implement this feature, it would require 50ms+ delay every time a single redis variable is retrieved, I do not think it's a good idea with Skript's limitations when it comes to multi threading

I have looked into sklib source code and it seems to be setting redis variables, not Skript variables. RediSkript only uses redis messaging functionality to transmit skript variables, it does not save them on the redis server so sklib isn't saving variables on the server, it does connection to redis server to get a variable when requested to implement this feature, it would require 50ms+ delay every time a single redis variable is retrieved, I do not think it's a good idea with Skript's limitations when it comes to multi threading
Owner

If someone makes one, I will accept a pull request that adds redis variables feature as a second option of managing variables.

If someone makes one, I will accept a pull request that adds redis variables feature as a second option of managing variables.
Govindas changed title from Please make it so redis variables can be updated even for offline servers. to Add ability to store variables inside redis server database 2022-08-12 08:22:11 +00:00
Govindas added the
help wanted
Suggestion
labels 2022-08-12 08:26:24 +00:00
Owner

if we look into SkriptDB it does make type for database we could make jedis class as type in skript?

if we look into SkriptDB it does make type for database we could make jedis class as type in skript?
Owner

sample skript code:

obtain resource from rediskript jedis pool to {_jedis_resource} # jedisPool.getResource();

set "redis key" to "value" using {_jedis_resource} # jedis.set("key", "value");


return resource {_jedis_resource} # jedis.close()

sample skript code: ``` obtain resource from rediskript jedis pool to {_jedis_resource} # jedisPool.getResource(); set "redis key" to "value" using {_jedis_resource} # jedis.set("key", "value"); return resource {_jedis_resource} # jedis.close() ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Limework/RediSkript#18
No description provided.