Skip to content

Commit 3e65202

Browse files
committed
made CaptureSession synchronous
1 parent a876b00 commit 3e65202

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/main/java/de/dmi3y/behaiv/session/CaptureSession.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ public CaptureSession(List<Provider> providers) {
2323
}
2424

2525
public void start(final Behaiv behaiv) {
26-
new Thread(new Runnable()
27-
{
28-
@Override
29-
public void run()
30-
{
31-
CaptureSession.this.startBlocking(behaiv);
32-
}
33-
}).start();
26+
//we delegate asynchronous handling to library users for now
27+
startBlocking(behaiv);
3428
}
3529

3630
public void startBlocking(Behaiv behaiv) {
@@ -46,14 +40,11 @@ public void startBlocking(Behaiv behaiv) {
4640
if (featureList.size() == 0) {
4741
throw new InputMismatchException("Feature size shouldn't be zero");
4842
}
49-
final List<Double> capturedFeatures = Single.zip(featureList, new Function<Object[], List<Double>>()
50-
{
43+
final List<Double> capturedFeatures = Single.zip(featureList, new Function<Object[], List<Double>>() {
5144
@Override
52-
public List<Double> apply(Object[] objects) throws Throwable
53-
{
45+
public List<Double> apply(Object[] objects) {
5446
List<Double> mapDoubleList = new ArrayList<>();
55-
for (Object obj : objects)
56-
{
47+
for (Object obj : objects) {
5748
mapDoubleList.addAll((List<Double>) obj);
5849
}
5950
return mapDoubleList;

0 commit comments

Comments
 (0)