Hanzi Design
Concept come

come · arrive

Wheat + Person

Come is movement toward observer or reference point. Unlike "go" which departs, "come" arrives. The directionality is relative to perspective—what comes to you goes from somewhere else. API responses come back to callers. Callback functions come when triggered. Events come to listeners. The come operation requires invitation or attraction—things don't come without reason to arrive. Pull-based systems make requests and wait for responses to come. Push-based systems send without being asked, but still frame delivery as coming to recipient. Come implies receptivity—someone or something must be ready to receive what arrives.

Arrival Perspective

Come emphasizes arrival rather than departure. The focus is reaching destination, not leaving origin. This makes come appropriate for operations viewed from recipient's perspective.

Return values come back to calling functions. Network responses come to requesting clients. Callback invocations come to registered handlers. The perspective is receiver-centric—what arrives matters more than what departed.

Designing arrival-focused operations requires ensuring recipient readiness. Callbacks need handlers registered. Clients need response parsers. Event listeners need event processing logic. The receiver infrastructure must exist before things can successfully come.

Invitation and Pull

Come often implies invitation. You come to party because invited. Data comes from API because requested. Events come to listeners because subscribed. The coming is response to pull.

Pull-based architectures depend on explicit requests. Client pulls data from server. Consumer pulls messages from queue. The pulling creates space for coming—request establishes that recipient wants and can handle what arrives.

Pull-based systems give recipients control over timing and rate. They pull when ready to process. The coming happens on recipient schedule. This prevents overwhelming recipients with arrivals they cannot handle.

Push vs. Pull Semantics

Some coming is pushed rather than pulled. Notifications come without being requested. Alerts come when thresholds exceed. The coming is sender-initiated, not receiver-initiated.

Push semantics assume recipient is always ready to receive. The sender decides when things come, not the receiver. This enables immediate delivery but risks overwhelming recipients.

Hybrid approaches combine push and pull. Server pushes availability notification. Client pulls actual data when ready. The notification comes unsolicited but data transfer happens on pull. The hybrid balances immediacy with recipient control.

Concurrent Arrivals

Multiple things can come simultaneously. HTTP server receives concurrent requests. Message queue delivers concurrent messages. The system must handle simultaneous arrivals.

Concurrency control manages concurrent coming. Thread pools limit simultaneous processing. Rate limits constrain arrival rates. Queues buffer excess arrivals. The controls prevent system overwhelm from too many concurrent arrivals.

Without concurrency control, arrival spikes cause failures. Memory exhausts from too many concurrent connections. CPU saturates from too many concurrent requests. The controls ensure sustainable arrival rates.

The Greeting Problem

When something comes, recipient must acknowledge arrival. HTTP responses require acknowledgment. Message deliveries need confirmation. The greeting confirms successful arrival.

Acknowledgment protocols vary by reliability requirements. TCP acknowledges every packet. HTTP acknowledges requests with responses. Message queues confirm delivery. The acknowledgment enables sender to verify arrival.

Missing acknowledgment creates uncertainty. Did it arrive but acknowledgment was lost? Or did it never arrive? The uncertainty complicates error handling. Idempotent operations help—delivering twice is safe, so resend if uncertain.

Expected vs. Unexpected Arrivals

Some coming is expected. Server expects requests. Subscribers expect messages. The system is prepared for these arrivals.

Unexpected coming requires different handling. Unexpected traffic spikes need scaling. Unexpected error rates need investigation. Unexpected data patterns need validation.

Distinguishing expected from unexpected requires baseline understanding. What arrival rate is normal? What patterns are typical? Anomaly detection identifies unexpected coming that deserves attention.

The Receiving Buffer

Arrivals often accumulate in buffers. Request queues buffer incoming HTTP requests. Message queues buffer incoming messages. The buffer holds arrivals until processing capacity is available.

Buffer sizing balances memory cost against arrival spike tolerance. Large buffers handle big spikes but consume memory. Small buffers are memory-efficient but overflow easily.

Buffer overflow handling determines system behavior under extreme load. Drop arrivals? Block senders? Reject with errors? The policy affects both system and caller behavior.

Arrival Order

Do things come in order sent or arbitrary order? TCP preserves order. UDP does not. Message queues may or may not guarantee order. The ordering affects processing logic.

Order-dependent processing requires either guaranteed-order delivery or receiver-side reordering. If arrivals can come out of order, receiver must sequence them correctly before processing.

Order-independent processing is simpler but not always possible. Some operations require specific sequencing. When order matters, ensure either delivery system preserves it or receiver handles reordering.

Arrival Rate Limits

How fast can things come? The rate limit determines maximum sustainable arrival throughput. Exceeding limits causes problems—queue overflow, resource exhaustion, service degradation.

Rate limiting controls arrival flow. Requests come at sustainable rate. Excess requests are rejected or delayed. The limiting prevents arrival-induced failures.

Rate limit placement matters. Limiting at edge (before arrivals enter system) prevents resource consumption. Limiting internally (after initial processing) allows more nuanced decisions but consumes more resources before rejecting.

The Welcome Procedure

What happens when something comes? The welcome procedure is receiver-side logic that handles arrivals. Parse request, validate input, route to handler, generate response.

Welcome procedure quality determines how well arrivals are processed. Efficient procedures handle high arrival rates. Inefficient procedures create bottlenecks.

Optimizing welcomes improves overall system throughput. Faster parsing, better validation, smarter routing—all enable handling more arrivals with same resources.

Come and Go Symmetry

Every come from one perspective is go from another. API response comes to client, goes from server. The symmetry means well-designed systems consider both perspectives.

Network protocols show this symmetry. Client goes to server with request. Server comes back to client with response. The protocol specifies both directions.

Designing only from one perspective creates problems. Receivers unprepared for arrivals. Senders without delivery confirmation. The complete design considers both coming and going.