• Home
Subscribe

perl

Migrating To async/await (part 3)

Things to consider when rewriting code to use the new async/await syntax provided by Future::AsyncAwait. In part 2 we looked at how to rewrite code using Future::Utils::repeat, into using the neater async/await syntax provided by Future::AsyncAwait. Now we'll conclude by taking a look at

  • Paul Evans
Paul Evans Jun 20, 2019 • 2 min read
perl

Migrating To async/await (part 2)

Things to consider when rewriting code to use the new async/await syntax provided by Future::AsyncAwait. In part 1 we looked at how to rewrite code that previously used plain Future on its own for sequencing operations, into using the neater async/await syntax provided by Future::AsyncAwait. In

  • Paul Evans
Paul Evans Jun 19, 2019 • 3 min read
perl

Migrating To async/await (part 1)

Things to consider when rewriting code to use the new async/await syntax provided by Future::AsyncAwait. The Future class provides basic asynchronous future functionality, and also a number of handy building-blocks for building larger code structures into meaningful programs. With the addition of the async/await syntax provided by

  • Paul Evans
Paul Evans Jun 18, 2019 • 4 min read
Future

Awaiting The Future (part 2)

A further look at Future::AsyncAwait, where it will go next and how we should be using it. In the previous part, I introduced the Future::AsyncAwait module, which adds the async and await pair of keywords. These help us to write many forms of code that use futures for

  • Paul Evans
Paul Evans Mar 28, 2019 • 5 min read
Future

Awaiting The Future (part 1)

Overview of a new syntax module for managing Future-based code IntroductionAt Binary, we have an increasing amount of code that uses Futures to represent asynchronous operations. The power of these objects comes with the increased complexity of writing readable code that makes use of them. Various articles I have previously

  • Paul Evans
Paul Evans Mar 26, 2019 • 3 min read
Devel::MAT

Differential Memory Leak Analysis with Devel::MAT

A look at a slow memory growth case and how recently-added features in Devel::MAT version 0.38 can help get to the bottom of it. Slow Growth Over Time Given a process that grows a small amount of memory over time, it can sometimes be difficult to look for

  • Paul Evans
Paul Evans Aug 2, 2018 • 5 min read
Perl improvements - going from 5.14 to 5.24
perl

Perl improvements - going from 5.14 to 5.24

Many things changed between Perl 5.14 to 5.24. Here's a brief overview of what to expect.

  • Tom Molesworth
Tom Molesworth Jul 24, 2018 • 5 min read
perl

A Catchy Way to Handle Failure (part 1)

A two-part look at failure handling in Perl Lets face it - failures sometimes happen. However well-laid our plans might be, there are times when the universe conspires against us, and we don't achieve the desired result. This is just as true for the programs we write. As with many

  • Paul Evans
Paul Evans Apr 20, 2018 • 4 min read
perl

Unit Testing Asynchronous Code

How writing asynchronous code using Futures can help simplify unit testing Well-tested code is always prefered over something that has no tests, as with more tests we can be more confident that the code actually does what we want it to. Within the realm of tests, there exists a spectrum

  • Paul Evans
Paul Evans Mar 21, 2018 • 6 min read
perl

Future Caching Tricks

Caching the results of Future-returning functions Often when making read requests or queries to some external service, it is helpful to cache the results of these queries so that other requests for the same information can use that directly, rather than having to repeat the query to that same service.

  • Paul Evans
Paul Evans Jan 12, 2018 • 3 min read
perl

One Thing At A Time

Limiting Concurrency in Future-based Programming Sometimes a Future-based program needs to actively avoid concurrency in one specific way or area, and ensure that only one instance of a given operation is outstanding at any one time. While the program as a whole can make use of concurrency to do multiple

  • Paul Evans
Paul Evans Dec 8, 2017 • 3 min read

Parallel query without parallel query

One of the key improvements in Postgres 9.6 has been the ability to distribute a query to multiple worker processes. Yet, with a few tricks this has been feasible almost forever at least for the really heavy stuff. I prefer to keep the database specific stuff in the database

  • Torsten Förtsch
Torsten Förtsch Dec 7, 2017 • 7 min read
How and why we implemented our own crypto cashier?
cryptocurrency

How and why we implemented our own crypto cashier?

Architecture overview and reasoning behind implementation of Binary.com crypto cashier.

  • Raunak Kathuria
Raunak Kathuria Nov 15, 2017 • 3 min read
An ERC20 securities token

An ERC20 securities token

Binary.com will be performing an ICO from 15 November to 25 December 2017, offering up to 10 million tokens which offer two exclusive rights: (1) the right to receive dividend-linked payments, and (2) the right to convert tokens into ordinary shares of the company. In practice, the tokens will

  • Jean-Yves Sireau
Jean-Yves Sireau Nov 6, 2017 • 4 min read
A Sense of Closure
perl

A Sense of Closure

A discussion came up the other day on the subject of how best to structure a certain piece of code, involving an IO::Async timer. The code in question was a watchdog, whose job is to alert the surrounding program to the fact that a connection appears to be dead,

  • Paul Evans
Paul Evans Nov 3, 2017 • 5 min read
Lock contention in Postgres

Lock contention in Postgres

At binary.com, our clients can trade in binary options. We keep all the related information in a PostgreSQL database. The life cycle of such an option begins when it is bought by a client. In our language this is called an open position. Later the client sells the position

  • Torsten Förtsch
Torsten Förtsch Oct 29, 2017 • 6 min read
PostgreSQL: How to use EXPLAIN output in SQL?

PostgreSQL: How to use EXPLAIN output in SQL?

Sometimes you want to process the EXPLAIN output in SQL. Unfortunately, EXPLAIN itself does not offer that option. However, there are tricks... Wrapping EXPLAIN in a function This is probably the simpler version. It requires to create a function: CREATE OR REPLACE FUNCTION explain( p_q TEXT, p_mod TEXT[

  • Torsten Förtsch
Torsten Förtsch Oct 29, 2017 • 1 min read
Tracing Perl memory leaks with Devel::MAT, part 2
Devel::MAT

Tracing Perl memory leaks with Devel::MAT, part 2

In the previous article we took a first look at how to use Devel::MAT to help find the reason why a perl process kept using more and more memory. The cause last time was found to be a single string scalar that grew to a huge 1.6GiB, consuming

  • Paul Evans
Paul Evans Oct 20, 2017 • 7 min read
Tracing Perl memory leaks with Devel::MAT, part 1
Devel::MAT

Tracing Perl memory leaks with Devel::MAT, part 1

The `Devel::MAT` ecosystem allows developers of perl programs to inspect and analyse memory-related problems such as memory leaks, unexpected memory consumption, or odd state.

  • Paul Evans
Paul Evans Oct 13, 2017 • 8 min read
Using Google Adwords ROAS bidding

Using Google Adwords ROAS bidding

At Binary.com we like Adwords' ROAS (Return on Ad Spend) bidding method as we believe it provides the best way to obtain the highest return on investment on Adwords spend. Here is how we configure our Adwords campaigns to maximise return on spend. Conversions First we need to decide

  • Jean-Yves Sireau
Jean-Yves Sireau Oct 10, 2017 • 4 min read
© 2022
Powered by Ghost