congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Agent$Action
Code IndexAdd Tabnine to your IDE (free)

How to use
Agent$Action
in
clojure.lang

Best Java code snippets using clojure.lang.Agent$Action (Showing top 10 results out of 315)

origin: clojure/clojure

((Action) next.q.peek()).execute();
origin: org.dunaj/clojure

((Action) next.q.peek()).execute();
origin: org.dunaj/clojure

synchronized public Object restart(Object newState, boolean clearActions){
  if(getError() == null)
    {
    throw Util.runtimeException("Agent does not need a restart");
    }
  validate(newState);
  state = newState;

  if(clearActions)
    aq.set(ActionQueue.EMPTY);
  else
    {
    boolean restarted = false;
    ActionQueue prior = null;
    while(!restarted)
      {
      prior = aq.get();
      restarted = aq.compareAndSet(prior, new ActionQueue(prior.q, null));
      }

    if(prior.q.count() > 0)
      ((Action) prior.q.peek()).execute();
    }

  return newState;
}

origin: org.dunaj/clojure

  public void run(){
    doRun(this);
  }
}
origin: org.dunaj/clojure

void enqueue(Action action){
  boolean queued = false;
  ActionQueue prior = null;
  while(!queued)
    {
    prior = aq.get();
    queued = aq.compareAndSet(prior, new ActionQueue((IPersistentStack)prior.q.cons(action), prior.error));
    }

  if(prior.q.count() == 0 && prior.error == null)
    action.execute();
}

origin: org.dunaj/clojure

public Object dispatch(IFn fn, ISeq args, Executor exec) {
  Throwable error = getError();
  if(error != null)
    {
    throw Util.runtimeException("Agent is failed, needs restart", error);
    }
  Action action = new Action(this, fn, args, exec);
  dispatchAction(action);

  return this;
}

origin: clojure/clojure

synchronized public Object restart(Object newState, boolean clearActions){
  if(getError() == null)
    {
    throw Util.runtimeException("Agent does not need a restart");
    }
  validate(newState);
  state = newState;

  if(clearActions)
    aq.set(ActionQueue.EMPTY);
  else
    {
    boolean restarted = false;
    ActionQueue prior = null;
    while(!restarted)
      {
      prior = aq.get();
      restarted = aq.compareAndSet(prior, new ActionQueue(prior.q, null));
      }

    if(prior.q.count() > 0)
      ((Action) prior.q.peek()).execute();
    }

  return newState;
}

origin: clojure/clojure

  public void run(){
    doRun(this);
  }
}
origin: clojure/clojure

void enqueue(Action action){
  boolean queued = false;
  ActionQueue prior = null;
  while(!queued)
    {
    prior = aq.get();
    queued = aq.compareAndSet(prior, new ActionQueue((IPersistentStack)prior.q.cons(action), prior.error));
    }

  if(prior.q.count() == 0 && prior.error == null)
    action.execute();
}

origin: clojure/clojure

public Object dispatch(IFn fn, ISeq args, Executor exec) {
  Throwable error = getError();
  if(error != null)
    {
    throw Util.runtimeException("Agent is failed, needs restart", error);
    }
  Action action = new Action(this, fn, args, exec);
  dispatchAction(action);

  return this;
}

clojure.langAgent$Action

Most used methods

  • <init>
  • doRun
  • execute

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JOptionPane (javax.swing)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now