06.02.2017, 17:47
Channels are a feature of the Redis Pub/Sub mechanism. You can have as many channels as you want and they are really just a method of tagging messages. This is built into Redis and will be exposed in my plugin so you can publish a message on a particular channel straight from Pawn and also subscribe to a channel from within Pawn and let other programs do all the hard work.
Redis in other languages is well documented, there's a Redis client in every popular language so you could write an app in your favourite language which interacts with the gamemode via Redis channels.
You can sort of do this via HTTP but it's largely one way (unless you poll from the gamemode via a timer, not ideal) whereas with this plugin you'll be able to "bind" a channel to a callback and have it react almost instantly to a message.
I've designed the first version API now, it'll look something like this:
More info here: https://github.com/Southclaws/samp-r...ster/readme.md
Redis in other languages is well documented, there's a Redis client in every popular language so you could write an app in your favourite language which interacts with the gamemode via Redis channels.
You can sort of do this via HTTP but it's largely one way (unless you poll from the gamemode via a timer, not ideal) whereas with this plugin you'll be able to "bind" a channel to a callback and have it react almost instantly to a message.
I've designed the first version API now, it'll look something like this:
PHP код:
Redis_Connect(host[], port, timeout) > ctx // connect to redis server
Redis_Close(ctx) // disconnect context from redis server
Redis_Command(ctx, command[], ...) // issue any Redis command (except SUBSCRIBE and PUBLISH)
Redis_Subscribe(ctx, channel[], callback[]) // waits for messages on channel and calls Pawn callback when message is received.
Redis_Publish(ctx, channel[]) // publish a message on channel