Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
org.dartlang.vm.service.internal.BlockingRequestSink Class Reference
Inheritance diagram for org.dartlang.vm.service.internal.BlockingRequestSink:
org.dartlang.vm.service.internal.RequestSink

Public Member Functions

 BlockingRequestSink (RequestSink base)
 
void add (JsonObject request)
 
void close ()
 
RequestSink toErrorSink (ResponseSink errorResponseSink, String errorResponseCode, String errorResponseMessage)
 
RequestSink toPassthroughSink ()
 
void add (JsonObject request)
 
void close ()
 

Detailed Description

A RequestSink that enqueues all requests and can be later converted into a "passthrough" or an "error" RequestSink.

Definition at line 25 of file BlockingRequestSink.java.

Constructor & Destructor Documentation

◆ BlockingRequestSink()

org.dartlang.vm.service.internal.BlockingRequestSink.BlockingRequestSink ( RequestSink  base)
inline

Definition at line 36 of file BlockingRequestSink.java.

36 {
37 this.base = base;
38 }

Member Function Documentation

◆ add()

void org.dartlang.vm.service.internal.BlockingRequestSink.add ( JsonObject  request)
inline

Put request into the sink.

Parameters
requestthe request to put, not null.

Implements org.dartlang.vm.service.internal.RequestSink.

Definition at line 41 of file BlockingRequestSink.java.

41 {
42 synchronized (queue) {
43 queue.add(request);
44 }
45 }

◆ close()

void org.dartlang.vm.service.internal.BlockingRequestSink.close ( )
inline

Close the communication channel.

Implements org.dartlang.vm.service.internal.RequestSink.

Definition at line 48 of file BlockingRequestSink.java.

48 {
49 base.close();
50 }

◆ toErrorSink()

RequestSink org.dartlang.vm.service.internal.BlockingRequestSink.toErrorSink ( ResponseSink  errorResponseSink,
String  errorResponseCode,
String  errorResponseMessage 
)
inline

Responds with an error to all the currently queued requests and return a RequestSink to do the same for all the future requests.

Parameters
errorResponseSinkthe sink to send error responses to, not null

Definition at line 58 of file BlockingRequestSink.java.

59 {
60 ErrorRequestSink errorRequestSink = new ErrorRequestSink(errorResponseSink, errorResponseCode,
61 errorResponseMessage);
62 synchronized (queue) {
63 for (JsonObject request : queue) {
64 errorRequestSink.add(request);
65 }
66 }
67 return errorRequestSink;
68 }

◆ toPassthroughSink()

RequestSink org.dartlang.vm.service.internal.BlockingRequestSink.toPassthroughSink ( )
inline

Returns the passthrough RequestSink.

Definition at line 73 of file BlockingRequestSink.java.

73 {
74 synchronized (queue) {
75 for (JsonObject request : queue) {
76 base.add(request);
77 }
78 }
79 return base;
80 }

The documentation for this class was generated from the following file: