Skip to content

Commit 4c0400f

Browse files
committed
Fixes
1 parent b8dbe8c commit 4c0400f

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The second thing we have to do is add the spawn dependency to the project.
9393
<dependency>
9494
<groupId>com.github.eigr</groupId>
9595
<artifactId>spawn-java-std-sdk</artifactId>
96-
<version>v0.8.5</version>
96+
<version>v0.8.6</version>
9797
</dependency>
9898
```
9999
We're also going to configure a few things for our application build to work, including compiling the protobuf files.
@@ -127,7 +127,7 @@ See below a full example of the pom.xml file:
127127
<dependency>
128128
<groupId>com.github.eigr</groupId>
129129
<artifactId>spawn-java-std-sdk</artifactId>
130-
<version>v0.8.5</version>
130+
<version>v0.8.6</version>
131131
</dependency>
132132
<dependency>
133133
<groupId>ch.qos.logback</groupId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>io.eigr.spawn</groupId>
55
<artifactId>spawn-java-std-sdk</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.8.5</version>
7+
<version>0.8.6</version>
88
<name>spawn-java-std-sdk</name>
99
<url>http://maven.apache.org</url>
1010

src/main/java/io/eigr/spawn/api/ActorRef.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,26 @@ private ActorRef(ActorOuterClass.ActorId actorId, SpawnClient client) {
3030
}
3131

3232
/**
33-
* <p>This method is responsible for creating instances of the ActorRef class when Actor is a UnNamed actor.
33+
* <p>This method is responsible for creating instances of the ActorRef class
3434
* </p>
3535
*
3636
* @param client is the client part of the Spawn protocol and is responsible for communicating with the Proxy.
37+
* @param cache is actor ids cache
3738
* @param identity ActorIdentity name of the actor that this ActorRef instance should represent
3839
* @return the ActorRef instance
3940
* @since 0.0.1
4041
*/
4142
protected static ActorRef of(SpawnClient client, Cache<ActorOuterClass.ActorId, ActorRef> cache, ActorIdentity identity) throws ActorCreationException {
42-
ActorOuterClass.ActorId actorId = buildActorId(identity.getSystem(), identity.getName(), identity.getParent());
43+
ActorOuterClass.ActorId actorId;
44+
45+
if (identity.isParent()) {
46+
actorId = buildActorId(identity.getSystem(), identity.getName(), identity.getParent());
47+
48+
spawnActor(actorId, client);
49+
} else {
50+
actorId = buildActorId(identity.getSystem(), identity.getName());
51+
}
52+
4353
ActorRef ref = cache.getIfPresent(actorId);
4454
if (Objects.nonNull(ref)) {
4555
return ref;

0 commit comments

Comments
 (0)