0

This is my code template

getLastMessageSingle()
.flatmap(
    message->
    if(message.image==null)
        Single.Just(message)
    else
        Single.zip(t1,t2,BiFunction<String,String,String>{
            s1,s2->
          //body sets data to message

          message
        })
)
//subscribe part

I found that Single.Just will execute but zip part is never executed. Am i doing any thing wrong or flat function does not support zip in it.

Any help will be appreciated thanks.

Solution:

It was my mistake second single t2 did not produce a response.

Arjun Gurung
  • 431
  • 3
  • 17

2 Answers2

0

I had a similar problem and i didn't understand the reason. The strange part is that when you use zip, only the last line which return a value is called!!! All the lines before that will not execute.

So i make a model and fill it with the responses and return it in last line and do all the logic part in my subscribe.

Omid Heshmatinia
  • 5,089
  • 2
  • 35
  • 50
0

Your two functions must give some response for zip to be produce a response.