Package akka.agent

Class Agent<T>


  • public abstract class Agent<T>
    extends java.lang.Object
    Deprecated.
    Agents are deprecated and scheduled for removal in the next major version, use Actors instead. Since 2.5.0.
    Java API: Read the internal state of the agent.
    • Constructor Summary

      Constructors 
      Constructor Description
      Agent()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract scala.concurrent.Future<T> alter​(scala.Function1<T,​T> f)
      Deprecated.
      Dispatch a function to update the internal state, and return a Future where that new state can be obtained.
      abstract scala.concurrent.Future<T> alter​(T newValue)
      Deprecated.
      Dispatch an update to the internal state, and return a Future where that new state can be obtained.
      abstract scala.concurrent.Future<T> alterOff​(scala.Function1<T,​T> f, scala.concurrent.ExecutionContext ec)
      Deprecated.
      Dispatch a function to update the internal state but on its own thread, and return a Future where that new state can be obtained.
      T apply()
      Deprecated.
      Read the internal state of the agent.
      static <T> Agent<T> create​(T initialValue, scala.concurrent.ExecutionContext context)
      Deprecated.
      Agents are deprecated and scheduled for removal in the next major version, use Actors instead.i
      abstract <B> Agent<B> flatMap​(scala.Function1<T,​Agent<B>> f)
      Deprecated.
      Flatmap this agent to a new agent, applying the function to the internal state.
      abstract <U> void foreach​(scala.Function1<T,​U> f)
      Deprecated.
      Applies the function to the internal state.
      abstract scala.concurrent.Future<T> future()
      Deprecated.
      A future to the current value that will be completed after any currently queued updates.
      abstract T get()
      Deprecated.
       
      abstract <B> Agent<B> map​(scala.Function1<T,​B> f)
      Deprecated.
      Map this agent to a new agent, applying the function to the internal state.
      abstract void send​(scala.Function1<T,​T> f)
      Deprecated.
      Dispatch a function to update the internal state.
      abstract void send​(T newValue)
      Deprecated.
      Dispatch a new value for the internal state.
      abstract void sendOff​(scala.Function1<T,​T> f, scala.concurrent.ExecutionContext ec)
      Deprecated.
      Dispatch a function to update the internal state but on its own thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Agent

        public Agent()
        Deprecated.
    • Method Detail

      • create

        public static <T> Agent<T> create​(T initialValue,
                                          scala.concurrent.ExecutionContext context)
        Deprecated.
        Agents are deprecated and scheduled for removal in the next major version, use Actors instead.i
        Java API: Factory method for creating an Agent.
        Parameters:
        initialValue - (undocumented)
        context - (undocumented)
        Returns:
        (undocumented)
      • get

        public abstract T get()
        Deprecated.
      • apply

        public T apply()
        Deprecated.
        Read the internal state of the agent.
        Returns:
        (undocumented)
      • send

        public abstract void send​(T newValue)
        Deprecated.
        Dispatch a new value for the internal state. Behaves the same as sending a function (x => newValue).
        Parameters:
        newValue - (undocumented)
      • send

        public abstract void send​(scala.Function1<T,​T> f)
        Deprecated.
        Dispatch a function to update the internal state. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
      • sendOff

        public abstract void sendOff​(scala.Function1<T,​T> f,
                                     scala.concurrent.ExecutionContext ec)
        Deprecated.
        Dispatch a function to update the internal state but on its own thread. This does not use the reactive thread pool and can be used for long-running or blocking operations. Dispatches using either sendOff or send will still be executed in order. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
        ec - (undocumented)
      • alter

        public abstract scala.concurrent.Future<T> alter​(T newValue)
        Deprecated.
        Dispatch an update to the internal state, and return a Future where that new state can be obtained. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        newValue - (undocumented)
        Returns:
        (undocumented)
      • alter

        public abstract scala.concurrent.Future<T> alter​(scala.Function1<T,​T> f)
        Deprecated.
        Dispatch a function to update the internal state, and return a Future where that new state can be obtained. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • alterOff

        public abstract scala.concurrent.Future<T> alterOff​(scala.Function1<T,​T> f,
                                                            scala.concurrent.ExecutionContext ec)
        Deprecated.
        Dispatch a function to update the internal state but on its own thread, and return a Future where that new state can be obtained. This does not use the reactive thread pool and can be used for long-running or blocking operations. Dispatches using either alterOff or alter will still be executed in order. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
        ec - (undocumented)
        Returns:
        (undocumented)
      • future

        public abstract scala.concurrent.Future<T> future()
        Deprecated.
        A future to the current value that will be completed after any currently queued updates.
        Returns:
        (undocumented)
      • map

        public abstract <B> Agent<B> map​(scala.Function1<T,​B> f)
        Deprecated.
        Map this agent to a new agent, applying the function to the internal state. Does not change the value of this agent. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • flatMap

        public abstract <B> Agent<B> flatMap​(scala.Function1<T,​Agent<B>> f)
        Deprecated.
        Flatmap this agent to a new agent, applying the function to the internal state. Does not change the value of this agent. In Java, pass in an instance of akka.dispatch.Mapper.
        Parameters:
        f - (undocumented)
        Returns:
        (undocumented)
      • foreach

        public abstract <U> void foreach​(scala.Function1<T,​U> f)
        Deprecated.
        Applies the function to the internal state. Does not change the value of this agent. In Java, pass in an instance of akka.dispatch.Foreach.
        Parameters:
        f - (undocumented)