grpc_dc library

Classes

CallContext
Per-call context: metadata sent in HEADERS.
Channel
Channel: the client side of one Endpoint.
ClientStream
Receives response messages of one call.
Codec
Frame codec for gRPC over WebRTC DataChannels (wire protocol in ../SPEC.md). Frame, status, channel and server semantics mirror the other grpcdc runtimes; the tables in wire.dart are stamped by the grpc-dc codegen.
DynamicClient
Runtime-built client: methods resolve from the FileModel.
DynamicHandler
Implements a service with generic messages.
DynamicStream
Receiving stream of generic responses.
Endpoint
Multiplexes grpc-dc streams over one Transport.
Event
EventBusBroker
In-memory grpcdc.events.v1.EventBus broker. Any peer can host it: register() it on a Server next to your own services, or call publishEvent directly in-process.
EventBusClient
Client for grpcdc.events.v1.EventBus.
EventBusServer
Service implementation interface for grpcdc.events.v1.EventBus.
EventBusSubscribeServer
Server-streaming sink passed to service implementations.
EventBusSubscribeStream
Receiving stream for EventBus/Subscribe responses.
EventsGrpcDc
Generated gRPC-over-DataChannels stubs for events.proto.
EventsPbField
EventsPbReader
EventsPbWriter
FieldModel
FileModel
Parsed descriptor set: messages and services by full name. Message keys carry the leading dot (".echo.EchoRequest"), matching FieldDescriptorProto.type_name; service keys do not ("echo.Echo").
GenericMessage
A message as field number -> list of values (descriptor order).
LocalSubscription
Handle for EventBusBroker.subscribeLocal: pull events in-process. take returns the next event (waiting up to the timeout), or null; dropped counts this subscription's drop-oldest losses.
Marshaler
Implemented by hand-written protobuf message types.
MessageModel
Method
One entry of a ServiceDesc.
MethodModel
PublishReply
PublishRequest
RequestStream
Reads request messages of one inbound call.
ResponseSink
Sends response payloads of one inbound call.
Server
Server: dispatches inbound calls to registered methods.
ServiceDesc
Describes a service for Server.registerService.
ServiceModel
StreamEvent
StreamInput
Receiving queue of one stream; closed after a terminal event.
SubscribeRequest
TagValue
TraceContext
One in-flight span's context.
Tracer
Observer for homegrown tracing (beta) (W3C traceparent propagation).
Transport
Carries whole DataChannel messages: one send is one message, boundaries preserved, ordered and reliable — the contract an RTCDataChannel (or the loopback pair) offers. Inbound messages arrive on onMessage; the stream completing means the transport closed.
Unmarshaler
Implemented by hand-written protobuf message types.
Wire
Frame type bytes and gRPC status codes (SPEC.md).

Enums

EventKind
Stream event kinds delivered to StreamInput queues.
Tag

Constants

subscriberQueueCapacity → const int
typeBool → const int
typeBytes → const int
typeDouble → const int
typeEnum → const int
typeFixed32 → const int
typeFixed64 → const int
typeFloat → const int
typeGroup → const int
typeInt32 → const int
typeInt64 → const int
typeMessage → const int
typeSfixed32 → const int
typeSfixed64 → const int
typeSint32 → const int
typeSint64 → const int
typeString → const int
typeUint32 → const int
typeUint64 → const int

Properties

tracingEnabled → bool
no setter

Functions

decodeGeneric(MessageModel model, List<int> data, FileModel file) → GenericMessage
encodeGeneric(MessageModel model, GenericMessage message, FileModel file) → Uint8List
EventsPbBitsToFloat32(int bits) → double
EventsPbBitsToFloat64(int bits) → double
formatTraceparent(String traceId, String spanId, bool sampled) → String
memoryTransportPair() → (Transport, Transport)
In-memory transport pair for tests (one queue per direction).
newTraceContext(String kind, String method) → TraceContext?
Start a root span context (client workflows). Pair with traceEnd.
parentOf(TraceContext? ctx) → ({bool sampled, String spanId, String traceId})?
View a span context as a traceparent parent.
parseDescriptorSet(List<int> data) → FileModel
Parse FileDescriptorSet bytes into a FileModel.
parseTraceparent(String? value) → ({bool sampled, String spanId, String traceId})?
publishEvent(EventBusClient client, List<TagValue> tags, List<int> payload, [String publisherId = '']) → Future<int>
Publish through a generated EventBusClient; returns the broker-assigned sequence number.
registerDynamicService(Server server, FileModel fileModel, String serviceName, DynamicHandler handler) → void
Register a runtime-built service on a Server.
setTraceFilter(String patterns) → void
Restrict traced methods: ';'-separated paths, a trailing '' means prefix match ('/echo.Echo/'). Empty = trace all.
setTracer(Tracer? tracer) → void
Register the global span observer (null disables tracing). Dormant until set: sampling/export are the app's problem.
subscribeEvents(EventBusClient client, List<TagValue> filterTags) → Future<EventBusSubscribeStream>
Subscribe through a generated EventBusClient; returns the receiving stream (listen to its responses, or close() it to unsubscribe).
tagBool(Tag tag, Object value) → TagValue
tagDouble(Tag tag, Object value) → TagValue
tagEnum(Tag tag, Object value) → TagValue
tagInt(Tag tag, Object value) → TagValue
tagsMatch(List<TagValue> eventTags, List<TagValue> filterTags) → bool
Containment match: the event is delivered when its tag list contains every (tag, value) pair of the filter. An empty filter matches everything.
tagString(Tag tag, Object value) → TagValue
tagValueKey(TagValue tv) → String
Stable key for one TagValue, e.g. "1|s:orders".
traceEnd(String kind, String method, TraceContext? ctx, String status) → void
traceStart(String kind, String method, ({bool sampled, String spanId, String traceId})? parent) → TraceContext?

Typedefs

Dispatcher = Future<StatusException?> Function(CallContext ctx, Headers headers, StreamInput input, ResponseSink sink)
Server-side call handler installed by Server. Returns the status that becomes the call's TRAILERS (null = OK).
DynamicRecvFn = Future<GenericMessage> Function()
Handler signatures for registerDynamicService.
DynamicSendFn = Future<void> Function(GenericMessage resp)
Headers = ({Map<String, String> metadata, String? path})
Parsed HEADERS payload: path == null means response headers.
MethodHandler = Future<void> Function(CallContext ctx, RequestStream reqs, ServerSink sink)
Implements one method against raw payloads; stubs adapt it.
ServerSink = void Function(List<int> payload)
Sends response payloads of one inbound call.

Exceptions / Errors

EndOfStreamError
Thrown at end of a receiving stream (call completed OK).
StatusException
A gRPC status (code + message) carried as an exception.