ndn-python-repo PubSub protocol publisher.

Implements

  • Disposable

Constructors

Properties

Methods

Constructors

Properties

cpOpts: {
    announcement?: FwFace.RouteAnnouncement;
    autoBuffer?: boolean;
    concurrency?: number;
    dataBuffer?: DataBuffer;
    dataSigner?: Signer;
    describe?: string;
    fw: Forwarder;
    modifyInterest?: Modify;
    retx?: RetxPolicy;
    routeCapture?: boolean;
    signal?: AbortSignal;
    verifier?: Verifier;
}

Type declaration

  • Optional announcement?: FwFace.RouteAnnouncement

    What name to be readvertised. Ignored if prefix is undefined.

  • Optional autoBuffer?: boolean

    Whether to add handler return value to .dataBuffer.

    Default Value

    true

    Remarks

    This is only relevant when .dataBuffer is set. If true, when the ProducerHandler returns a Data packet, it is automatically inserted to the DataBuffer.

  • Optional concurrency?: number

    How many Interests to process in parallel.

    Default Value

    1
    
  • Optional dataBuffer?: DataBuffer

    Outgoing Data buffer.

    Remarks

    Providing an outgoing Data buffer allows the ProducerHandler to prepare multiple Data packets in response to one Interest, in which one Data satisfies the current Interest and additional Data satisfy upcoming Interest. This is useful for a producer that generates a multi-segment response triggered by a single Interest, such as a StatusDataset producer in NFD Management protocol.

    The producer can prepare the Data packets and insert them to the DataBuffer, and then return undefined, so that the Interest is used to query the DataBuffer and the first matching Data is sent. The producer can also return a specify Data packet to satisfy the current Interest.

  • Optional dataSigner?: Signer

    If specified, automatically sign Data packets that are not yet signed.

    Remarks

    If the ProducerHandler returns a Data packet that is not signed (its SigType is Null), it is automatically signed with this signer.

    This option does not apply to Data packets manually inserted into .dataBuffer. To auto-sign those packet, specify DataStoreBuffer.Options.dataSigner in addition.

  • Optional describe?: string

    Description for debugging purpose.

    Default Value

    "consume" + Interest name.
    
  • fw: Forwarder

    Logical forwarder instance.

    Default Value

    Forwarder.getDefault()

  • Optional modifyInterest?: Modify

    Modify Interest according to specified options.

    Default Value

    undefined, no modification.

  • Optional retx?: RetxPolicy

    Retransmission policy.

    Default Value

    undefined, no retransmission.

  • Optional routeCapture?: boolean

    Whether routes registered by producer would cause @ndn/fw internal FIB to stop matching toward shorter prefixes.

    Default Value

    true

    Remarks

    If all nexthops of a FIB entry are set to non-capture, FIB lookup may continue onto nexthops on FIB entries with shorter prefixes. One use case is in dataset synchronization protocols, where both local and remote sync participants want to receive each other's Interests.

  • Optional signal?: AbortSignal

    AbortSignal that allows canceling the Interest via AbortController.

  • Optional verifier?: Verifier

    Data verifier.

    Default Value

    undefined, no verification.

pubFwHint?: Name
pubPrefix: Name

Methods

  • Returns void

  • Publish an item.

    Parameters

    • topic: Name

      Topic name.

    • item: Item

      An Encodable to be published, or a function to generate one.

    Returns Promise<void>

    Promise that resolves when the publication has reached a subscriber.