Skip to content

🔴 Redis pub-sub implementation to effectively handle data

Notifications You must be signed in to change notification settings

InvisRaidinq/redstone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔴 Redstone

Redstone is a Redis pub-sub implementation using Jedis which enables easy and effective handling of data.

Usage

An example implementation can be found here if you don't want a step-by-step walkthrough.

Implementing Redstone is incredibly easy. First you'll need to obtain an instance of the Redstone interface:

final Redstone redstone = Redstone.builder()
    .address("127.0.0.1")
    .port(6379)
    .channel("redis-channel-here")
    .build();                    

Packets can be published with the redstone#sendPacket method.

Creating your first packet

A packet is simply a class that implements RedstonePacket:

public class SomePacket implements RedstonePacket {
    private final String someString;
    private final UUID someUuid;
    private final double someDouble;

    public SomePacket(String someDouble, UUID someUuid, double someDouble) {
        this.someString = someString;
        this.someUuid = someUuid;
        this.someDouble = someDouble;
    }

    @Override
    public void onReceive() {
        // Handle receiving of this packet here
    }
}

When receiving a packet, it will automatically be deserialzied using the Google Gson library, meaning you might have to add support for non-supported objects.

License

This project uses the MIT license, meaning you're pretty much free to do whatever with it!

About

🔴 Redis pub-sub implementation to effectively handle data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages