Examples of AFn


Examples of clojure.lang.AFn

        return value;
    }

    public AFn getInputLookupFn() {
        final InputOutputCache cache = this;
        return new AFn() {
            @Override
            public Object invoke(Object arg1) {
                return cache.getInput(convertToInteger(arg1));
            }
        };
View Full Code Here

Examples of clojure.lang.AFn

        };
    }

    public AFn getOutputLookupFn() {
        final InputOutputCache cache = this;
        return new AFn() {
            @Override
            public Object invoke(Object arg1) {
                return cache.getOutput(convertToInteger(arg1));
            }
        };
View Full Code Here

Examples of clojure.lang.AFn

             "(context \"/coroutineSocketAndCompojure\" [] coroutine-socket-test-handler)" +
//             "coroutine-socket-test-handler" +
           ")";
//    final IFn fn = (IFn)RT.var("clojure.core", "eval").invoke(RT.var("clojure.core","read-string").invoke(code));
   
    final IFn fn = new AFn() {
      @Override
      public Object invoke(Object req)  {
        final Coroutine co = Coroutine.getActiveCoroutine();
        Thread selfresume = new Thread() {
          public void run() {
View Full Code Here

Examples of clojure.lang.AFn

 
 
  @Test
  public void testSimpleHandler4() {
 
    IFn fn = new AFn() {
      @Override
      public Object invoke(Object arg1) throws SuspendExecution {
        System.out.println("before");
        final Coroutine cr = Coroutine.getActiveCoroutine();
        new Thread() {
View Full Code Here

Examples of clojure.lang.AFn

            }
        }, bucketSize);

        final MemoryMXBean jvmMemRT = ManagementFactory.getMemoryMXBean();

        context.registerMetric("memory/heap", new MemoryUsageMetric(new AFn() {
            public Object invoke() {
                return jvmMemRT.getHeapMemoryUsage();
            }
        }), bucketSize);
        context.registerMetric("memory/nonHeap", new MemoryUsageMetric(new AFn() {
            public Object invoke() {
                return jvmMemRT.getNonHeapMemoryUsage();
            }
        }), bucketSize);
View Full Code Here

Examples of clojure.lang.AFn

      }
    }, bucketSize);

    final MemoryMXBean jvmMemRT = ManagementFactory.getMemoryMXBean();

    context.registerMetric("memory/heap", new MemoryUsageMetric(new AFn() {
      public Object invoke() {
        return jvmMemRT.getHeapMemoryUsage();
      }
    }), bucketSize);
    context.registerMetric("memory/nonHeap", new MemoryUsageMetric(
        new AFn() {
          public Object invoke() {
            return jvmMemRT.getNonHeapMemoryUsage();
          }
        }), bucketSize);
View Full Code Here

Examples of com.github.krukow.clj_lang.AFn

    //Checking all states up to: N
    for (int i = 0; i < N; i++) {
      vec = vec.cons(i);
     
    }
    IPersistentVector vector = PersistentVector.vectormap(new AFn() {
      @Override
      public Object invoke(Object arg1) {
        Integer s = (Integer )arg1;
        return s.intValue()*2;
      }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.