Package erjang

Examples of erjang.ETuple


    return -1;

  }

  private void tcp_error_message(int err) throws Pausable {
    ETuple spec = ETuple.make(am_tcp_error, port(), EAtom.intern(Posix
        .errno_id(err)));
    driver_output_term(spec);
  }
View Full Code Here


      task.status &= ~EDriverTask.ERTS_PORT_SFLG_PORT_BUSY;
    }
  }

  private void inet_reply_ok(EHandle caller2) throws Pausable {
    ETuple msg = ETuple.make(am_inet_reply, port(), ERT.am_ok);
    EHandle caller = this.caller;
    this.caller = null;

    if (log.isLoggable(Level.FINER) && caller != null) {
      log.finer("sending to " + caller + " ! " + msg);
View Full Code Here

      ByteBuffer tail = out.slice();
      out.flip();
      data = EBinary.make(tail);
    }

    ETuple res = ETuple.make(am_inet_async, port(), ERT.box(op.id),
        new ETuple2(ERT.am_ok, data));

    if (log.isLoggable(Level.FINER)) {
      log.finer("sending to " + op.caller + " ! " + res);
    }
View Full Code Here

    /*
     * send message:* {inet_reply, Port, Ref, {error,Reason}}
     */
    EHandle caller = this.caller;
    this.caller = null;
    ETuple msg = ETuple.make(am_inet_reply, port(), new ETuple2(
        ERT.am_error, reason));
    if (portlog.isLoggable(Level.FINER)) {
      portlog.finer("sending to " + caller + " ! " + msg);
    }
   
View Full Code Here

  private boolean send_async_error(short id, EPID caller, EObject reason) throws Pausable {
    /*
     * send message:* {inet_async, Port, Ref, {error,Reason}}
     */

    ETuple msg = ETuple.make(am_inet_async, port(), ERT.box(id),
        new ETuple2(ERT.am_error, reason));
    if (portlog.isLoggable(Level.FINER)) {
      portlog.finer("sending to " + caller + " ! " + msg);
    }
    caller.send(port(), msg);
View Full Code Here

    caller.send(port(), msg);
    return  true;
  }

  private boolean send_async_ok(int id, EPID caller) throws Pausable {
    ETuple msg = ETuple.make(am_inet_async, port(), ERT.box(id), ERT.am_ok);
    if (portlog.isLoggable(Level.FINER)) {
      portlog.finer("sending to " + caller + " ! " + msg);
    }
    caller.send(port(), msg);
    return true;
View Full Code Here

    caller.send(port(), msg);
    return true;
  }

  private boolean send_async_ok_port(int id, EPID caller, EPort port2) throws Pausable {
    ETuple msg = ETuple.make(am_inet_async, port(), ERT.box(id),
        new ETuple2(ERT.am_ok, port2));
    if (portlog.isLoggable(Level.FINER)) {
      log.finer("sending to " + caller + " ! " + msg);
    }
    caller.send(port(), msg);
View Full Code Here

    EFun f = fun.testFunction();
    if (f != null) {
      res = apply_last(proc, f, a);
    } else {

      ETuple t = fun.testTuple();
      if (t == null) {
        throw ERT.badfun(fun);
      }
 
      ETuple2 t2 = ETuple2.cast(t);
View Full Code Here

  }

  @BIF
  public static EObject apply(EProc proc, EObject one, EObject two, EObject three) throws Pausable {
    EAtom mod = one.testAtom();
    ETuple t = one.testTuple();
    JavaObject jo = one.testJavaObject();
   
    EAtom fun = two.testAtom();
    ESeq  args = three.testSeq();
   
View Full Code Here

    // Calculating the date using GregorianCalendar is rather slow, so we cache.
    // As stamp, we use 'midnight at the end of the day', in minutes since Epoch.
      long millis = System.currentTimeMillis();
      int curMinutes = (int)(millis / MILLIS_PER_MINUTE);
    int[] cacheValidUntilMinutes = new int[1];
    ETuple cachedResult = cachedDate.get(cacheValidUntilMinutes);
    if (curMinutes < cacheValidUntilMinutes[0&& cachedResult != null) { // Still valid
      return cachedResult;
    }

    // Cache is invalid.
    // Calculate the current date:
    GregorianCalendar cal = new GregorianCalendar();
    int year = cal.get(Calendar.YEAR);
    int month = cal.get(Calendar.MONTH)+1;
    int day = cal.get(Calendar.DAY_OF_MONTH);

    ETuple result = ETuple.make(ERT.box(year), ERT.box(month), ERT.box(day));

    // Calculate valid-until, i.e. next midnight:
    cal.add(Calendar.DAY_OF_YEAR, 1);
    cal.set(Calendar.HOUR, 0);
    cal.set(Calendar.MINUTE, 0);
View Full Code Here

TOP

Related Classes of erjang.ETuple

Copyright © 2018 www.massapicom. 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.