Blocking Calls Reference

This page lists all function and method calls that the sk module auto-detects as blocking. If your code uses any of these, .asynced() and .background() become available.

Note: Detection is case-insensitive.

Note: You can always use the @blocking decorator to explicitly mark code as blocking when AST detection doesn't catch it (for things like heavy, time consuming CPU bound work)


Exact Blocking Calls

These are matched exactly (full call path).

Time / Sleep

File I/O

OS Module

Subprocess

Requests

HTTPX

urllib / urllib3

Socket

Pathlib

Shutil

Database Connectors

Redis

MongoDB

AWS / Boto3

Kafka / RabbitMQ

Elasticsearch / OpenSearch

Database Cursor/Connection


Blocking Method Patterns

If any call ends with one of these method names, it's considered blocking.

Core Blocking

Socket / Network

File I/O

Database

AWS S3

AWS DynamoDB

AWS SQS / SNS

MongoDB

Redis

Elasticsearch / OpenSearch

Kafka / RabbitMQ

Other Databases

Suitkaise


Broad Blocking Patterns

These method names are only considered blocking when the call path contains an I/O context keyword.

Broad Methods

I/O Context Keywords

For a broad method to trigger blocking detection, the call path must contain one of these:

Databases

Cloud / AWS

Messaging / Search

Data Stores

Networking


Examples

Detected as blocking

time.sleep(1)                    # exact match: time.sleep
requests.get(url)                # exact match: requests.get
cursor.fetchall()                # pattern match: fetchall
self.db.execute(query)           # broad match: execute + db context
s3_client.get_object(...)        # pattern match: get_object

NOT detected as blocking

my_dict.get("key")               # broad method, no I/O context
data.update({"a": 1})            # broad method, no I/O context
calculate()                      # unknown function

Use @blocking for undetected cases

from suitkaise import sk, blocking

@sk
@blocking
def cpu_intensive():
    # pure computation, no I/O calls
    return sum(x**2 for x in range(10_000_000))