Skip to content

Commit

Permalink
Re-architect the structure: BPrograms are now run by BProgramRunners,…
Browse files Browse the repository at this point in the history
… rather than on their own
  • Loading branch information
michbarsinai committed Mar 22, 2017
1 parent 4e3ba15 commit aeb415d
Show file tree
Hide file tree
Showing 35 changed files with 553 additions and 493 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,17 @@ a link to this page somewhere in the documentation/system about section.

## Change log for the BPjs library.



### 2017-03-21

* :sparkles: New architecture: Running logic moved from `BProgram` to `BProgramRunner` - ongoing.
* :sparkles: `BProgramListener`s notified before BPrograms are started.

### 2017-03-21

* :sparkles: New architecture: Running logic moved from `BProgram` to `BProgramRunner`. This will help implementing search.
* :sparkles: `BProgramListener`s notified when a b-thread runs to completion.
* :sparkles: `bp.getTime()` added.
* :sparkles: Updated tutorial now includes the `bp` object.

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/il/ac/bgu/cs/bp/bpjs/ContinuationGames.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package il.ac.bgu.cs.bp.bpjs;

import il.ac.bgu.cs.bp.bpjs.bprogram.runtimeengine.BProgram;
import il.ac.bgu.cs.bp.bpjs.bprogram.runtimeengine.BProgramRunner;
import il.ac.bgu.cs.bp.bpjs.bprogram.runtimeengine.BThreadSyncSnapshot;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -18,6 +19,8 @@
/**
* Playing around with continuations.
*
* TODO: The BPP class should be a BProgramRunner now.
*
* @author michael
*/
public class ContinuationGames {
Expand All @@ -38,7 +41,6 @@ protected void setupProgramScope(Scriptable scope) {
+ "});", "");
}

@Override
public void mainEventLoop() throws InterruptedException {
try {
BThreadSyncSnapshot bt = bthreads.iterator().next();
Expand Down Expand Up @@ -98,6 +100,6 @@ public void mainEventLoop() throws InterruptedException {

public static void main(String[] args) throws Exception {
BProgram bpp = new BPP();
bpp.start();
new BProgramRunner(bpp).start();
}
}
Loading

0 comments on commit aeb415d

Please sign in to comment.