const BASE_URL = "/api/search";
export async function searchProducts(query, { signal } = {}) {
const params = new URLSearchParams({ q: query, limit: "10" });
const res = await fetch(`${BASE_URL}?${params}`, {
signal,
<?php
namespace App\Message;
final class SyncCustomerMessage
{
use async_trait::async_trait;
use std::io;
#[async_trait]
pub trait ConnectionFactory: Send + Sync + 'static {
type Connection: Send + 'static;
package feed
import "time"
type Event struct {
ID string `json:"id"`
public class ProductAggregator implements AutoCloseable {
private final RemoteServices services;
private final ExecutorService pool = Executors.newFixedThreadPool(8);
public ProductAggregator(RemoteServices services) {
import { useCallback, useEffect, useReducer } from "react";
type State = { secondsLeft: number; isRunning: boolean };
type Action =
| { type: "start"; seconds: number }
| { type: "tick" }
module Retryable
module_function
def with_retries(tries: 3, base: 0.3, cap: 5.0, on: [StandardError])
attempt = 0
begin
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.time.Instant;
<?php
namespace App\Events;
use App\Models\Order;
use Illuminate\Broadcasting\PrivateChannel;
class ProjectPresenter
def initialize(project, include_tasks: true)
@project = project
@include_tasks = include_tasks
end
package com.example.storage;
import jakarta.validation.Valid;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
package com.shop.api.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;