GithubHelp home page GithubHelp logo

yar-client-java's Introduction

Yar RPC Client for Java

Build Status Coverage Status JitPack

A simple Java client for Yar RPC framework.

Introduction

Yar is a light RPC framework for PHP written by Laruence. If you are looking for a Java client for Yar, this project may solve your problems.

Usage

Use this client is very simple, just few codes:

YarClient client = new YarClient("http://localhost/yar.php");
Integer timestamp = client.call("doSomething", Integer.class, "Hello");
System.out.println(timestamp);
client.close();

Downloads

Jar

Coming soon..

Maven

Add the JitPack repository to your build file.

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

Add the dependency in the form.

<dependency>
    <groupId>com.github.starlight36</groupId>
    <artifactId>yar-client-java</artifactId>
    <version>v0.1.4</version>
</dependency>

Build

To build this project, just use maven.

mvn clean package -Dmaven.test.skip=true

Test

To test this project, you need to provide a php http server listening on localhost:8095. src/test/resources/yar.php is the server script.

Use php build-in server is a good idea.

php -ddate.timezone=PRC -dextension=yar.so -S 127.0.0.1:8095 -t src/test/resources

Limitation

  • Native PHP packager is not support correctly.
  • Concurrent or asynchronous call is not support temporarily.
  • Only support HTTP transport, socket transport is planed.

Feedback

If you any questions, use Issues.

yar-client-java's People

Contributors

starlight36 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yar-client-java's Issues

Class 'Yar_Server' not found

➜ yar-client-java git:(master) php -ddate.timezone=PRC -dextension=yar.so -S 127.0.0.1:8095 -t src/test/resources
[Fri Apr 1 14:31:35 2016] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php70/7.0.0-rc.3_2/lib/php/extensions/no-debug-non-zts-20141001/yar.so' - dlopen(/usr/local/Cellar/php70/7.0.0-rc.3_2/lib/php/extensions/no-debug-non-zts-20141001/yar.so, 9): image not found in Unknown on line 0


Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php70/7.0.0-rc.3_2/lib/php/extensions/no-debug-non-zts-20141001/yar.so' - dlopen(/usr/local/Cellar/php70/7.0.0-rc.3_2/lib/php/extensions/no-debug-non-zts-20141001/yar.so, 9): image not found in Unknown on line 0

PHP 7.0.0RC3 Development Server started at Fri Apr 1 14:31:35 2016
Listening on http://127.0.0.1:8095
Document root is /Users/qk/mygithub/yar-client-java/src/test/resources
Press Ctrl-C to quit.
[Fri Apr 1 14:31:39 2016] PHP Fatal error: Uncaught Error: Class 'Yar_Server' not found in /Users/qk/mygithub/yar-client-java/src/test/resources/yar.php:49
Stack trace:
#0 {main}

thrown in /Users/qk/mygithub/yar-client-java/src/test/resources/yar.php on line 49
[Fri Apr 1 14:31:39 2016] 127.0.0.1:15637 [200]: /yar.php - Uncaught Error: Class 'Yar_Server' not found in /Users/qk/mygithub/yar-client-java/src/test/resources/yar.php:49
Stack trace:
#0 {main}

thrown in /Users/qk/mygithub/yar-client-java/src/test/resources/yar.php on line 49

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.