Package

ru.primetalk.synapse.core

components

Permalink

package components

Visibility
  1. Public
  2. All

Type Members

  1. trait Component extends Named

    Permalink

    An outer description of a system.

    An outer description of a system. Actual description is deferred to descendants. See also Links

  2. trait ComponentWithInternalStructure extends Component with WithStaticSystem

    Permalink

    Transparent component whose internal structure can be represented as a StaticSystem.

  3. trait ComponentsApi extends AnyRef

    Permalink

    Import components to core package.

  4. class Contact[T] extends Named with Serializable

    Permalink

    Basis point of connection of other elements.

    Basis point of connection of other elements. If auxiliary then it is drawn on the graph as a simple little circle.

    It order to improve performance the contact is compared by referential equality (#eq()). That's why it is not a case class. However, this creates some inconvenience in serialization.

    NB: the contact is not very well serializable. After deserialization we obtain a different instance of the contact. But in most cases the comparison is done by referential equality (.eq) and thus it won't do well.

    In synapse-grid-akka there is a solution for Contact serializations.

    See also

    ru.primetalk.synapse.akka.ContactSerializer.

  5. case class FlatMapLink[-T1, +T2](f: (T1) ⇒ GenTraversableOnce[T2]) extends LinkInfo[T1, T2] with Product with Serializable

    Permalink

    The kind of link that does sequential transformation of data.

  6. case class InnerSystemComponent(s: StaticSystem, stateHandle: StateHandle[Map[Contact[_], Any]], sharedStateHandles: List[StateHandle[_]] = Nil) extends Component with ComponentWithInternalStructure with Product with Serializable

    Permalink

    The system that can be embedded into some other static system.

    The system that can be embedded into some other static system. It has specially processed state:

    s

    structure of the system

    stateHandle

    the handle within parent system that holds internal system's state. The handle points to the map (stateHandle -> value)

    sharedStateHandles

    a few state handles that are shared between the parent system and child. During runtime processing current values from parent are copied to child state before processing any signals and copied back afterwards.

  7. case class Link[T1, T2, -TL1 >: T1, +TL2 <: T2](from: Contact[T1], to: Contact[T2], name: String, info: LinkInfo[TL1, TL2]) extends Named with TwoPoleComponent[T1, T2] with Product with Serializable

    Permalink

    The Link is represented with a triple of two contacts and a linkInfo

    The Link is represented with a triple of two contacts and a linkInfo

    Special care is taken for type variants. Contacts are invariant because data is "set" and "get". However, the function is contra- and co- variant, because it is a function. So we have two additional types TL1, TL2.

  8. sealed trait LinkInfo[-T1, +T2] extends AnyRef

    Permalink

    LinkInfo are individually processed functions with different signatures.

  9. trait Named extends AnyRef

    Permalink

    Named is used to store graph specific information - label or name.

  10. case class NopLink[-T1, +T2 >: T1]() extends LinkInfo[T1, T2] with Product with Serializable

    Permalink

    This link can connect contacts of the same type.

  11. case class RedMapLink[-T1, +T2](stopContacts: Set[Contact[_]]) extends LinkInfo[T1, T2] with Product with Serializable

    Permalink

    Prioritize contacts when some data passes through this link.

    Prioritize contacts when some data passes through this link. Processes until the data is only on stopContacts. "Fires" starting from the initial contact until "firewall" contacts. TODO: move to Components.

  12. trait RttiContactExt extends ContactsDsl

    Permalink

  13. case class Signal[T](contact: Contact[T], data: T) extends Product with Serializable

    Permalink

    Signal is a pair of contact and data on it.

    Signal is a pair of contact and data on it. Two methods are provided to match those of pairs - _1 and _2.

  14. case class SignalDist(contactId: Int, data: AnyRef) extends Product with Serializable

    Permalink

    Signal for remote transfer.

    Signal for remote transfer. The real contacts are not quite well serializable (see Contact for details). Thus we use the position of the contact in the system's index.

  15. trait SignalsApi extends ContactsDsl

    Permalink

  16. class StateHandle[S] extends Contact[S] with Stateful[S]

    Permalink

    Permanent contacts store shared state that can be updated with stateful links.

  17. case class StateUpdate[S, T2](from: Contact[T2], stateHandle: StateHandle[S], name: String, f: (S, T2) ⇒ S) extends Component with Product with Serializable

    Permalink

    Special component that atomically updates state.

    Special component that atomically updates state. It doesn't have any output contact.

  18. case class StateZipLink[S, -T1, +T2 >: T1](stateHolder: StateHandle[S]) extends LinkInfo[T1, (S, T2)] with Product with Serializable

    Permalink

    Zips state value with the inner data and

  19. trait Stateful[State] extends AnyRef

    Permalink

    Stateful elements of the system.

  20. case class StatefulFlatMapLink[S, -T1, +T2](f: (S, T1) ⇒ (S, GenTraversableOnce[T2]), stateHolder: StateHandle[S]) extends LinkInfo[T1, T2] with Product with Serializable

    Permalink

    The kind of link that does sequential transformation of data.

    The kind of link that does sequential transformation of data. The function itself has state that is transformed every time. Prefer to use StateZipLink (?)

  21. case class StaticSystem(inputs: List[Contact[_]], outputs: List[Contact[_]], privateStateHandles: List[StateHandle[_]], components: List[Component], name: String, extensions: Map[StaticSystemExtensionId[_], Any] = Map()) extends Component with Named with Stateful[Map[Contact[_], Any]] with ComponentWithInternalStructure with Product with Serializable

    Permalink

    The core class for SynapseGrid.

    The core class for SynapseGrid. Contains an immutable description of a system.

    inputs

    input contacts of the system. Within the system it is prohibited to send signals on them.

    outputs

    output contacts of the system. Within the system it is prohibited to connect outgoing links to these contacts. This is due to the fact that the signals that come to output contacts are not processed within the system. They are delayed for processing by the outer system.

    privateStateHandles

    state identifiers for variables available within the system. The system itself is immutable and it is prohibited to save state somewhere in closures or global vars (due to thread unsafety). Instead the system's internal state is "provided" by runtime system in the form of map stateHandle->value. updates of states can be done only in a purely functional way.

    components

    inner parts of the system - links, subsystems and other blocks. They have inputs and outputs.

    name

    the system's name extension methods: unhandledExceptionHandler - user-defined exception handler. It can recover from exception by returning repaired Context, log it or rethrow. index - ContactsIndex styles - ContactsStyles

  22. trait StaticSystemExtensionId[+T] extends AnyRef

    Permalink

    ExtensionId for a StaticSystem extension.

    ExtensionId for a StaticSystem extension. Every extension can be installed only once on the same StaticSystem.

    The extension can contain some additional state for system processing.

    However, it is not recommended to add mutable state to otherwise immutable StaticSystem.

  23. trait TwoPoleComponent[T1, T2] extends Component

    Permalink

    A component that has single input and single output.

  24. trait WithStaticSystem extends AnyRef

    Permalink

Value Members

  1. object Contact extends Serializable

    Permalink

  2. object StateHandle extends Serializable

    Permalink

  3. object StateUpdate extends Serializable

    Permalink
  4. object StaticSystem extends Serializable

    Permalink

  5. object WithStaticSystem

    Permalink

Ungrouped