bioclipse / bioclipse.openphacts

Bioclipse client for OpenPHACTS
1 stars 0 forks source link

improved API for batching return data #3

Open egonw opened 9 years ago

egonw commented 9 years ago

improve the manager API to not use (int page, int size) for batching results, but integrate the count and list calls, use the BC API for batching return values, also allowing canceling BC calls.

For example, the current manager API has:

getPharmacologyCountForTarget(CWResult target)
getPharmacologyListForTarget(CWResult target, int page, int size)

However, the Bioclipse API for batched return values should be used, allowing the above two calls to be merged into:

getPharmacologyForTarget(CWResult target)

Where this will internally use a (configurable?) amount of results (former "size"). This has the advantage that the GUI will be more responsive and results may show up earlier, and that a call can be cancelled. Internally, the count and list API methods will be used, which has the added benefit that the method will have a reasonable progress bar.

jonalv commented 9 years ago

We should consider returning an iterator. We have the IReturner in Bioclipse for iterating over results as they become available in the method for doing partial returns from a manager as descibed here

That iterator will probably need a cache as well