Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.
/ Memes4J Public archive

Async/Sync Java wrapper for get random reddit memes

License

Notifications You must be signed in to change notification settings

Blad3Mak3r/Memes4J

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memes4J

This package is behind used in production by HUGE


You can also get this package for other programming languages:

Packages
Java
Node.js
Deno

Getting started

This package requires Java 9 or higher version.

The static method Memes4J.getRandomMeme() returns a PendingRequest class which can be asynchronously terminated with queue(), submit() or sync with complete()

Get a random meme

getRandomMeme() or getRandomMeme(string).

Create the PendingRequest object

PendingRequest request = Memes4J.getRandomMeme()

Async Consumer/BiConsumer with queue()

request.queue((meme) -> {
    System.out.println(meme.toString());
}, (error) -> {
    error.printStackTrace();
})

Async CompletableFuture with sumbit()

CompletableFuture<Meme> future = request.submit();

future.whenCompleteAsync((meme) -> {
    System.out.println(meme.toString());
}, (throwable) -> {
    throwable.printStackTrace();
})

Sync complete()

try {
    Meme meme = request.complete();
    System.out.println(meme.toString());
} catch(Exception ex) {
    ex.printStackTrace();
}

How to download

With Gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
        implementation 'com.github.Blad3Mak3r:Memes4J:0.1.1'
}

With Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.Blad3Mak3r</groupId>
    <artifactId>Memes4J</artifactId>
    <version>0.1.1</version>
</dependency>

About

Async/Sync Java wrapper for get random reddit memes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages