Skip to content

Simple Gearman implementation in ABCL Common lisp using FFI Java Calls

Notifications You must be signed in to change notification settings

alejandrozf/abcl-gearman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

abcl-gearman

Alejandro Zamora Fonseca [email protected]

A simple implementation of a Gearman client & worker using https://github.com/gearman/java-service with ABCL(https://abcl.org/) FFI calls.

Useful as a example for use ABCL to load external Java library.

Quick start

  • Clone the system to your quicklisp local-projects folder

  • docker run --rm -p 4730:4730 artefactual/gearmand:1.1.19.1-alpine

CL-USER> (ql:quickload :abcl-gearman)
To load "abcl-gearman":
  Load 1 ASDF system:
    abcl-gearman
; Loading "abcl-gearman"

(:ABCL-GEARMAN)
CL-USER> (in-package :abcl-gearman)
#<PACKAGE ABCL-GEARMAN>
ABCL-GEARMAN> (create-running-worker "echo")
NIL
ABCL-GEARMAN> (submit-job "echo" :data (java:jcall "getBytes" "Bulgaria"))
#<org.gearman.impl.client.GearmanJobReturnImpl org.gearman.impl.client.GearmanJ.... {E4FF3C5B}>

"Worker returning ..."
ABCL-GEARMAN> (require :jss)
NIL
ABCL-GEARMAN> (jss:get-java-field ** "eventList" t)
#<java.util.LinkedList [GearmanJobEvent: GEARMAN_SUBMIT.... {400F9EE2}>
#<java.lang.reflect.Field private final java.util.Deque or.... {83E96F99}>
ABCL-GEARMAN> (java:jcall "toString" *)
"[GearmanJobEvent: GEARMAN_SUBMIT_SUCCESS : H:46011f87b16e:6, GearmanJobEvent: GEARMAN_JOB_SUCCESS : Bulgaria]"
ABCL-GEARMAN>

License

MIT

About

Simple Gearman implementation in ABCL Common lisp using FFI Java Calls

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published