GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bogdad/cocaine-framework-java: Cocaine Java Framework

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

117 Commits
117 Commits

Folders and files

NameName
Last commit message
Last commit date
cmake
cmake
 
 
debian
debian
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
README.md
README.md
 
 
build.xml
build.xml
 
 

Repository files navigation

Cocaine framework java

Currently it is only java-bindings for dealer

Building

Prerequisites

To build cocaine-framework-java you'll need

  • libcocaine-dealer
  • ant

generating artifacts

cd to cocaine-framework-java directory and run ant

Output

in cocaine-framework-java

  • ./target/jars/yandex-cocaine-dealer.jar
  • ./target/lib/lib-cocaine-framework-java.so

Usage example

package cocaine.dealer;

import java.util.concurrent.TimeUnit;

public class UsageExample {
    public static void main(String[] args) {

        String dealerConfig = "./src/test/resoueces/dealer_config.json";
        String appHandlePath = "myapp/myhandle";
        Dealer dealer = null;
        byte[] message = "helloworld".getBytes();
        MessagePolicy messagePolicy = MessagePolicy.builder()
                .maxRetries(10)
                .sendToAllHosts()
                .timeout(10, TimeUnit.SECONDS)
                .deadline(10, TimeUnit.DAYS)
                .build();
        try {
            dealer = new Dealer(dealerConfig);
            Response response = null;
            try {
                response = dealer.sendMessage(appHandlePath, message,
                        messagePolicy);
                for (byte[] chunk : response.asIterable(10, TimeUnit.SECONDS)) {
                    System.out.println(new String(chunk));
                }
            } finally {
                if (response != null) {
                    response.close();
                }
            }
        } finally {
            if (dealer != null)
                dealer.close();
        }
    }
}

About

Cocaine Java Framework

Resources

Readme
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.