File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
entities/src/main/scala/com/devsisters/shardcake Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -348,10 +348,8 @@ class Sharding private (
348348 case MessengerTimeout .Timeout (duration) => Some (duration)
349349 }
350350
351- def broadcastDiscard (topic : String )(msg : Msg ): UIO [Unit ] = {
352- val send = sendMessage(topic, msg, None )
353- timeout.fold(send.unit)(t => send.timeout(t).unit)
354- }
351+ def broadcastDiscard (topic : String )(msg : Msg ): UIO [Unit ] =
352+ sendMessage(topic, msg, None ).unit
355353
356354 def broadcast [Res ](topic : String )(msg : Replier [Res ] => Msg ): UIO [Map [PodAddress , Try [Res ]]] =
357355 Random .nextUUID.flatMap { uuid =>
@@ -375,7 +373,9 @@ class Sharding private (
375373
376374 val send = trySend.flatMap {
377375 case Some (value) => ZIO .succeed(value)
378- case None => ZIO .fail(new Exception (s " Send returned nothing, topic= $topic" ))
376+ case None =>
377+ if (replyId.isDefined) ZIO .fail(new Exception (s " Send returned nothing, topic= $topic" ))
378+ else ZIO .succeed(null .asInstanceOf [Res ])
379379 }
380380 timeout
381381 .fold(send)(t => send.timeoutFail(new Exception (s " Send timed out, topic= $topic" ))(t))
You can’t perform that action at this time.
0 commit comments