Isomorphic,
I had a doubt regarding DSCallbacks.
I have two scenarios.
In First scenario,
Im trying to run one data fetch inside DSCallback of another data fetch. Here both are having same DataSource but different DSRequest. This is nested to 3 levels(Here I have shown 2).
DataSource dataSource = DataSource.get("ds1");
DSRequest dsRequest = new DSRequest();
dsRequest.setOperationId("opID1");
dataSource.fetchData(null, new DSCallback() {
@Override
public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
DSRequest dsRequest2 = new DSRequest();
dsRequest2.setOperationId("opID2");
dataSource.fetchData(null, new DSCallback() {
//Code goes here
}, dsRequest2);
//Code goes here
}
}, dsRequest);
In the second scenario im trying to run one data fetch inside DSCallback of another data fetch. Here both are having different DSRequest as well as different DataSource. This is nested to 3 levels(Here I have shown 2).
DataSource dataSource = DataSource.get("ds1");
DSRequest dsRequest = new DSRequest();
dsRequest.setOperationId("opID1");
dataSource.fetchData(null, new DSCallback() {
@Override
public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
DataSource dataSource2 = DataSource.get("ds2");
DSRequest dsRequest2 = new DSRequest();
dsRequest2.setOperationId("opID2");
dataSource2.fetchData(null, new DSCallback() {
//Code goes here
}, dsRequest2);
//Code goes here
}
}, dsRequest);
What I'm observing here is that the nested data fetches aren't happening syncronously in both the scenarios. Is there anyway I can get them running syncronously?? aren't nested DSCallbacks supposed to run syncronously?
Vinod
I had a doubt regarding DSCallbacks.
I have two scenarios.
In First scenario,
Im trying to run one data fetch inside DSCallback of another data fetch. Here both are having same DataSource but different DSRequest. This is nested to 3 levels(Here I have shown 2).
DataSource dataSource = DataSource.get("ds1");
DSRequest dsRequest = new DSRequest();
dsRequest.setOperationId("opID1");
dataSource.fetchData(null, new DSCallback() {
@Override
public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
DSRequest dsRequest2 = new DSRequest();
dsRequest2.setOperationId("opID2");
dataSource.fetchData(null, new DSCallback() {
//Code goes here
}, dsRequest2);
//Code goes here
}
}, dsRequest);
In the second scenario im trying to run one data fetch inside DSCallback of another data fetch. Here both are having different DSRequest as well as different DataSource. This is nested to 3 levels(Here I have shown 2).
DataSource dataSource = DataSource.get("ds1");
DSRequest dsRequest = new DSRequest();
dsRequest.setOperationId("opID1");
dataSource.fetchData(null, new DSCallback() {
@Override
public void execute(DSResponse dsResponse, Object o, DSRequest dsRequest) {
DataSource dataSource2 = DataSource.get("ds2");
DSRequest dsRequest2 = new DSRequest();
dsRequest2.setOperationId("opID2");
dataSource2.fetchData(null, new DSCallback() {
//Code goes here
}, dsRequest2);
//Code goes here
}
}, dsRequest);
What I'm observing here is that the nested data fetches aren't happening syncronously in both the scenarios. Is there anyway I can get them running syncronously?? aren't nested DSCallbacks supposed to run syncronously?
Vinod
Comment