Skip to content
devandroad
All posts

Hello, world

Why I built devandroad and what you'll find here.

1 min readLeia este post em português

After seven years building integrations, automations and chatbots, I decided to put what I do, what I’m building and what I enjoy outside of code in one place.

That’s where the name devandroad comes from: dev and road. Half the time I’m writing code, the other half I’m out on my motorcycle.

What you’ll find here

  • Integrations and backend: Go, PHP, queues, retries, SFTP, EDI and everything that keeps systems talking without falling over.
  • Products: building Pétrus, a scheduling platform for car detailing businesses.
  • Hobbies: 3D printing, home automation and some travel.

A first example

A pattern I use in almost every integration is retry with exponential backoff:

func withRetry(ctx context.Context, attempts int, fn func() error) error {
	delay := 500 * time.Millisecond
	for i := 0; i < attempts; i++ {
		if err := fn(); err == nil {
			return nil
		}
		select {
		case <-time.After(delay):
			delay *= 2
		case <-ctx.Done():
			return ctx.Err()
		}
	}
	return fmt.Errorf("failed after %d attempts", attempts)
}

A retry like this one eliminated the recurring monthly failures of an integration I maintained. Small, but it solves a lot.

See you in the next post.