Tabnine Logo
ObjectPipe.publishTailPosition
Code IndexAdd Tabnine to your IDE (free)

How to use
publishTailPosition
method
in
com.ociweb.pronghorn.pipe.ObjectPipe

Best Java code snippets using com.ociweb.pronghorn.pipe.ObjectPipe.publishTailPosition (Showing top 4 results out of 315)

origin: oci-pronghorn/GreenLightning

private boolean publishMultiResponseDBUpdate(long conId, long seqCode) {
  boolean result =  service.publishHTTPResponse(conId, seqCode, 200,
                    HTTPContentTypeDefaults.JSON,
                    w-> {
                      Templates.multiTemplate.render(w, collectorDBUpdate);
                      int c = collectorDBUpdate.size();
                      while (--c>=0) {
                        assert(collectorDBUpdate.get(c).getConnectionId() == conId);
                        assert(collectorDBUpdate.get(c).getSequenceId() == seqCode);					    						   
                        collectorDBUpdate.get(c).setStatus(-1);
                      }
                      collectorDBUpdate.clear();
                      DBUpdateInFlight.publishTailPosition();
                    });
  collectionPendingDBUpdate = !result;
  return result;
}

origin: oci-pronghorn/GreenLightning

private boolean publishMultiDBResponse(long conId, long seqCode) {
  final boolean result =  service.publishHTTPResponse(conId, seqCode, 200,
                    HTTPContentTypeDefaults.JSON,
                    w-> {
                      Templates.multiTemplateDBRest.render(w, collectorDBRest);
                                            int c = collectorDBRest.size();
                      assert(collectorDBRest.get(0).getGroupSize()==c);
                      while (--c >= 0) {
                        assert(collectorDBRest.get(0).getGroupSize()==collectorDBRest.size());
                        assert(collectorDBRest.get(c).getConnectionId() == conId) : c+" expected conId "+conId+" error: "+showCollection(collectorDBRest);
                        assert(collectorDBRest.get(c).getSequenceId() == seqCode) : c+" sequence error: "+showCollection(collectorDBRest);    						   
                        collectorDBRest.get(c).setStatus(-1);
                                             }
                      collectorDBRest.clear();                                               
                      DBRestInFlight.publishTailPosition();
                    });
  collectionPendingDBRest = !result;
  return result;
}
origin: oci-pronghorn/GreenLightning

private boolean consumeResultObjectDBRest(final ResultObject t) {
  boolean ok;
          
  ///////////////////////////////
  if (0 == t.getGroupSize()) {	
    ok = service.publishHTTPResponse(t.getConnectionId(), t.getSequenceId(), 200,
        HTTPContentTypeDefaults.JSON,
        w-> {
          Templates.singleTemplateDBRest.render(w, t);
          t.setStatus(-1);
          DBRestInFlight.moveTailForward();//only move forward when it is consumed.
          DBRestInFlight.publishTailPosition();
        });                    
  } else {
    //collect all the objects
    assert(isValidToAdd(t, collectorDBRest));
    collectorDBRest.add(t);                    
    DBRestInFlight.moveTailForward();
    if (collectorDBRest.size() == t.getGroupSize()) {
      //now ready to send, we have all the data						
      ok =publishMultiDBResponse(t.getConnectionId(), t.getSequenceId());
      
    } else {
      ok = true;//added to list
    }    
    //moved forward so we can read next but write logic will still be blocked by state not -1			 
    
  }
  return ok;
}
origin: oci-pronghorn/GreenLightning

fortuneInFlight.publishTailPosition();
t.list().clear();
htmlFortuneBuffer.clear();
com.ociweb.pronghorn.pipeObjectPipepublishTailPosition

Popular methods of ObjectPipe

  • <init>
  • count
  • hasRoomFor
  • headObject
  • isHeadThread
  • isTailThread
  • moveHeadForward
  • moveTailForward
  • tailObject

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Path (java.nio.file)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now