• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

labrad / pylabrad / 695
60%

Build:
DEFAULT BRANCH: master
Ran 27 Sep 2016 04:51PM UTC
Jobs 1
Files 57
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
695

push

travis-ci

web-flow
Add ThreadedServer class to handle requests in a thread pool (#294)

Currently, most client-side code uses the synchronous Client class for talking to labrad, which blocks when making requests or returns Futures to allow for firing multiple requests and awaiting the results later. However, server-side code runs in the twisted reactor thread, uses AsyncClient, and must work in non-blocking fashion using twisted Deferreds (or inlineCallbacks). Among other things, this makes it hard to reuse code between servers and clients.

Here we implement a ThreadedServer class that handles requests and other lifecycle callbacks in a thread pool, and makes a synchronous Client available for using the server's labrad connection to make requests. This makes it possible to write server code in the more familiar blocking style and share this code between client and server, while still handling multiple requests concurrently on the server.

Implementing a ThreadedServer requires care to maintain thread safety of any shared data. For situations where concurrent request handling is not needed, we also provide a SingleThreadedServer class that dispatches server lifecycle methods and requests on a single thread. This makes it possible to implement a server without thinking about thread-safety or locks, but only one request can be handled at a time.

Review: @kunalq, @ejeffrey

4709 of 8933 relevant lines covered (52.71%)

0.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 695.1 (SCALABRAD_VERSION=0.5.1) 27 Sep 2016 04:51PM UTC 0
52.71
Travis Job 695.1
Source Files on build 695
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #695
  • b2d061c8 on github
  • Prev Build on master (#680)
  • Next Build on master (#696)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc