Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Variables
VERSION := 1.0-SNAPSHOT
VERSION := 1.3.0
PACKAGE := target/spawn-java-demo-${VERSION}-shaded.jar

clean:
Expand Down
580 changes: 340 additions & 240 deletions README.md

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>io.eigr.spawn</groupId>
<artifactId>spawn-java-std-sdk</artifactId>
<packaging>jar</packaging>
<version>1.2.7</version>
<version>1.3.0</version>
<name>spawn-java-std-sdk</name>
<url>http://maven.apache.org</url>

Expand Down Expand Up @@ -59,6 +59,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.7</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
Expand Down Expand Up @@ -110,7 +117,8 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.65.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/io/eigr/spawn/api/ActorRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ public final class ActorRef {

private final SpawnClient client;

private ActorRef(ActorOuterClass.ActorId actorId, SpawnClient client) {
private final Class type;

private ActorRef(ActorOuterClass.ActorId actorId, SpawnClient client, Class type) {
this.client = client;
this.actorId = actorId;
this.type = type;
}

/**
Expand All @@ -39,7 +42,7 @@ private ActorRef(ActorOuterClass.ActorId actorId, SpawnClient client) {
* @return the ActorRef instance
* @since 0.0.1
*/
protected static ActorRef of(SpawnClient client, Cache<ActorOuterClass.ActorId, ActorRef> cache, ActorIdentity identity) throws ActorCreationException {
protected static ActorRef of(SpawnClient client, Cache<ActorOuterClass.ActorId, ActorRef> cache, ActorIdentity identity, Class actorType) throws ActorCreationException {
ActorOuterClass.ActorId actorId;

if (identity.isParent()) {
Expand All @@ -59,7 +62,7 @@ protected static ActorRef of(SpawnClient client, Cache<ActorOuterClass.ActorId,
spawnActor(actorId, client);
}

ref = new ActorRef(actorId, client);
ref = new ActorRef(actorId, client, actorType);
cache.put(actorId, ref);
return ref;
}
Expand Down Expand Up @@ -94,6 +97,10 @@ protected static void spawnAllActors(List<ActorOuterClass.ActorId> actorIds, Spa
client.spawn(req);
}

public Class getType() {
return this.type;
}

/**
* <p>This method synchronously invokes an action on the actor that this ActorRef instance represents through the Spawn Proxy.
* Used when it is not necessary to send parameters to the Action.
Expand Down
Loading