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

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Socket (java.net)
    Provides a client-side TCP socket.
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JList (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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