Skip to content

Instantly share code, notes, and snippets.

@JarvisCraft
Last active Mar 28, 2019
Embed
What would you like to do?
Project April <Annotation Remote Procedure Call API>

Project April

Standard

TODO

Idea

Project April is an API invented for annotation-based approach in creating distributed services.

Terminology:

Remote procedure = Remote method = RP

Procedure (method) whose execution is delegated to a Data-provider server (most commonly, on other physical machine) via the Distributor server

Node

Data-user, Distributor or Data-provider

Data-user( server) = DU

Server containing Remote procedures delegated to Distributor server. May be registered in Distributor server(s). Multiple may occur optionally joined by a single Data network.

Distributor( server) = DS

Server responsible for accepting requests for Remote procedure executionm processing them to Data-provider server(s) and returning the result (if any). Multiple may occur joined by a single Data network.

Data-provider( server) = DP = ~Executor

Server responsible for execution of procedures (methods) for whom the are local. Should be registered in Distribution server(s). Multiple may occur joined by a single Data network.

(Data-)network

Group of Data-users, Distributors and Data-providers joined for cooperative work.

Data( flow)

Stream of data between Data-user, Distributor and Data-provider. Normally goes from the first to the last and backwards.

API

Components

Shared

Network ID: NetworkId

Object unique for each node in a Network used for its identefication amongst others.

On Data-user server

Remote interface: RemoteInterface

Interface describing methods of a RP. May contain non-RP methods.

Remote-interface factory: RemoteInterfaceFactory

Factory capable of creatng runtime implementations of Remote interfaces.

@Remote on method

Method in Remote-interface expected to be executed using April. Contains targetColor prameter indicating the target color of this method's executor.

On Distributor server

Network info: NetworkInfo

Data about the network. Should be similar between DSs of the same network.

Requests pool: RequestsPool

Object capable of effective distribution of requested remote procedures via data-providers

On Data-provider server

Color-flag: @ColorFlag on RemoteMethodImpl

Object used for identifying functional purpose of this DP. Multiple may occur.

Remote-interface implementation: RemoteInterfaceImplementation

Object describing behaviour of a foreign RP being executed on this machine. Should be registered in Remote-interface implementation handler

@RemoteImpl

Method in Remote-interface implementation expected to be executed using April

Remote-interface implementation handler RemoteInterfaceImplementationHandler

Manager capable of accepting requests from distributor server delegating them to registered Remote-interface implementations.

Other

@Cached on a @Remote method

Indicator that the RemoteInterfaceFactory should cache the results of this method call for all its parameters or only those which are annotated as @CacheKey

@NonShared on a @Remote method

Indicator that the same Data-provider should be used for this method calls always or only for the same values of parameters annotated as @NonSharingKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment