public class ProductAggregator implements AutoCloseable {
private final RemoteServices services;
private final ExecutorService pool = Executors.newFixedThreadPool(8);
public ProductAggregator(RemoteServices services) {
<?php
namespace App\Policies;
use App\Models\Article;
use App\Models\User;
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;
class OrderPresenter < SimpleDelegator
attr_reader :current_user
def initialize(order, current_user:)
super(order)
@current_user = current_user
package com.example.feed;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
class OrderCreationService
Result = Struct.new(:success?, :order, :error, keyword_init: true)
def initialize(customer:, line_params:)
@customer = customer
@line_params = line_params