_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c178000
// BeginCall starts a new call to this specific peer, returning an OutboundCall that can // be used to write the arguments of the call.
c178001
// NumConnections returns the number of inbound and outbound connections for this peer.
c178002
// NumPendingOutbound returns the number of pending outbound calls.
c178003
// isEphemeralHostPort returns if hostPort is the default ephemeral hostPort.
c178004
// Get returns the value stored for the given key.
c178005
// Set sets the value for a given key.
c178006
// ClearAll clears all the keys.
c178007
// NewChannel creates a new Channel. The new channel can be used to send outbound requests // to peers, but will not listen or handling incoming requests until one of ListenAndServe // or Serve is called. The local service name should be passed to serviceName.
c178008
// Serve serves incoming requests using the provided listener. // The local peer info is set synchronously, but the actual socket listening is done in // a separate goroutine.
c178009
// ListenAndServe listens on the given address and serves incoming requests. // The port may be 0, in which case the channel will use an OS assigned port // This method does not block as the handling of connections is done in a goroutine.
c178010
// Register registers a handler for a method. // // The handler is registered with the service name used when the Channel was // created. To register a handler with a different service name, obtain a // SubChannel for that service with GetSubChannel, and Register a handler // under that. You may also use SetHandler on ...
c178011
// PeerInfo returns the current peer info for the channel
c178012
// GetSubChannel returns a SubChannel for the given service name. If the subchannel does not // exist, it is created.
c178013
// serve runs the listener to accept and manage new incoming connections, blocking // until the channel is closed.
c178014
// Ping sends a ping message to the given hostPort and waits for a response.
c178015
// StatsTags returns the common tags that should be used when reporting stats. // It returns a new map for each call.
c178016
// Connect creates a new outbound connection to hostPort.
c178017
// exchangeUpdated updates the peer heap.
c178018
// updatePeer updates the score of the peer and update it's position in heap as well.
c178019
// addConnection adds the connection to the channel's list of connection // if the channel is in a valid state to accept this connection. It returns // whether the connection was added.
c178020
// removeClosedConn removes a connection if it's closed. // Until a connection is fully closed, the channel must keep track of it.
c178021
// connectionCloseStateChange is called when a connection's close state changes.
c178022
// State returns the current channel state.
c178023
// NewReader returns a reader that reads typed values from the reader.
c178024
// ReadUint16 reads a uint16.
c178025
// ReadString reads a string of length n.
c178026
// ReadLen16String reads a uint16-length prefixed string.
c178027
// Register function adds JSON and Thrift handlers to the server channel ch
c178028
// Run executes the trace behavior
c178029
// Get returns a relay timer that has not started. Timers must be started explicitly // using the Start function.
c178030
// Put returns a relayTimer back to the pool.
c178031
// Start starts a timer with the given duration for the specified ID.
c178032
// Release releases a timer back to the timer pool. The timer MUST have run or be // stopped before Release is called.
c178033
// NewTCPFrameRelay relays frames from one connection to another. It reads // and writes frames using the TChannel frame functions.
c178034
// Create a sub-scope for this set of known tags.
c178035
// Isolated is a SubChannelOption that creates an isolated subchannel.
c178036
// Isolated returns whether this subchannel is an isolated subchannel.
c178037
// Register registers a handler on the subchannel for the given method. // // This function panics if the Handler for the SubChannel was overwritten with // SetHandler.
c178038
// GetHandlers returns all handlers registered on this subchannel by method name. // // This function panics if the Handler for the SubChannel was overwritten with // SetHandler.
c178039
// StatsTags returns the stats tags for this subchannel.
c178040
// Register a new subchannel for the given serviceName
c178041
// Get subchannel if, we have one
c178042
// GetOrAdd a subchannel for the given serviceName on the map
c178043
// Discover queries Hyperbahn for a list of peers that are currently // advertised with the specified service name.
c178044
// Start begins a Crossdock client in the background.
c178045
// WriteRequest writes a http.Request to the given writers.
c178046
// ReadRequest reads a http.Request from the given readers.
c178047
// NewReadBufferWithSize returns a ReadBuffer with a given capacity
c178048
// ReadByte returns the next byte from the buffer.
c178049
// ReadBytes returns the next n bytes from the buffer
c178050
// ReadString returns a string of size n from the buffer
c178051
// ReadUint16 returns the next value in the buffer as a uint16
c178052
// ReadUint32 returns the next value in the buffer as a uint32
c178053
// ReadUint64 returns the next value in the buffer as a uint64
c178054
// ReadUvarint reads an unsigned varint from the buffer.
c178055
// ReadLen8String reads an 8-bit length preceded string value
c178056
// ReadLen16String reads a 16-bit length preceded string value
c178057
// FillFrom fills the buffer from a reader
c178058
// Wrap initializes the buffer to read from the given byte slice
c178059
// WriteSingleByte writes a single byte to the buffer
c178060
// WriteBytes writes a slice of bytes to the buffer
c178061
// WriteUint16 writes a big endian encoded uint16 value to the buffer
c178062
// WriteUint32 writes a big endian uint32 value to the buffer
c178063
// WriteUint64 writes a big endian uint64 to the buffer
c178064
// WriteUvarint writes an unsigned varint to the buffer
c178065
// WriteLen8String writes an 8-bit length preceded string
c178066
// WriteLen16String writes a 16-bit length preceded string
c178067
// DeferByte reserves space in the buffer for a single byte, and returns a // reference that can be used to update that byte later
c178068
// DeferBytes reserves space in the buffer for a fixed sequence of bytes, and // returns a reference that can be used to update those bytes
c178069
// FlushTo flushes the written buffer to the given writer
c178070
// Reset resets the buffer to an empty state, ready for writing
c178071
// Wrap initializes the buffer to wrap the given byte slice
c178072
// Update updates the uint16 in the buffer
c178073
// Update updates the uint32 in the buffer
c178074
// Update updates the uint64 in the buffer
c178075
// Update updates the bytes in the buffer
c178076
// UpdateString updates the bytes in the buffer from a string
c178077
// The ArgReader will handle fragmentation as needed. Once the argument has // been read, the ArgReader must be closed.
c178078
// finish finishes the fragment, updating the final checksum and fragment flags
c178079
// newWritableChunk creates a new writable chunk around a checksum and a buffer to hold data
c178080
// writeAsFits writes as many bytes from the given slice as fits into the chunk
c178081
// newFragmentingWriter creates a new fragmenting writer
c178082
// ArgWriter returns an ArgWriter to write an argument. The ArgWriter will handle // fragmentation as needed. Once the argument is written, the ArgWriter must be closed.
c178083
// BeginArgument tells the writer that the caller is starting a new argument. // Must not be called while an existing argument is in place
c178084
// Write writes argument data, breaking it into fragments as needed
c178085
// Flush flushes the current fragment, and starts a new fragment and chunk.
c178086
// Close ends the current argument.
c178087
// handleCallRes handles an incoming call req message, forwarding the // frame to the response channel waiting for it
c178088
// Arg2Reader returns an ArgReader to read the second argument. // The ReadCloser must be closed once the argument has been read.
c178089
// handleError handles an error coming back from the peer. If the error is a // protocol level error, the entire connection will be closed. If the error is // a request specific error, it will be written to the request's response // channel and converted into a SystemError returned from the next reader or // access ca...
c178090
// doneReading shuts down the message exchange for this call. // For outgoing calls, the last message is reading the call response.
c178091
// newFragment creates a new fragment for marshaling into
c178092
// flushFragment sends a fragment to the peer over the connection
c178093
// failed marks the writer as having failed
c178094
// arg1Reader returns an ArgReader to read arg1.
c178095
// arg2Reader returns an ArgReader to read arg2.
c178096
// arg3Reader returns an ArgReader to read arg3.
c178097
// argReader returns an ArgReader that can be used to read an argument. The // ReadCloser must be closed once the argument has been read.
c178098
// recvNextFragment receives the next fragment from the underlying message exchange.
c178099
// releasePreviousFrament releases the last fragment returned by the reader if // it's still around. This operation is idempotent.