twose
Repos
38
Followers
605
Following
23

Coroutine-based concurrency library for PHP

C
799
78

🚀 Coroutine-based concurrency library for PHP

17598
3150

The PHP Interpreter

C
34369
7008

🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.

4814
966

Cross-platform asynchronous I/O

C
20169
3070

The coroutine version of libuv, mainly used by Swow for now

C
59
12

Events

push

Move Builder binary to ext dir

Fix test name

Fix some bad/dead code

[BC break] Move Http\Message related classes to its own namespace

Should keep alive renames

Add TODO comment

Move Http related classes of library to its own namespace

Move Debugger to its own namespace

ConnectionManager is only used by Psr7

So let it be in Psr namespace for now.

Remove PHP_LF constant for tests

CS-Fix for ext/tests/include/bootstrap.php

Use WeakMap for ServerConnectionManager and move LimitationTrait to Psr7\Config

Apply CS rules for all php and phpt files

Fix some unexpected PHP-CS-Fixer rules

class_definition single_line was set by SymfonySet.

Fix PHPStan warnings

Move WebSocketTrait to Psr7\Protocol namespace

Add FIXME comment

Rename to HttpException and move it to Http\Message

Notice that we always close the connection when ServerResponseException occurred, but not when BusinessException was thrown.

Make C variable name be consistent with PHP class name

Support more extension build/clean commands

Created at 1 day ago
push

Remove PHP_LF constant for tests

CS-Fix for ext/tests/include/bootstrap.php

Use WeakMap for ServerConnectionManager and move LimitationTrait to Psr7\Config

Apply CS rules for all php and phpt files

Fix some unexpected PHP-CS-Fixer rules

class_definition single_line was set by SymfonySet.

Fix PHPStan warnings

Move WebSocketTrait to Psr7\Protocol namespace

Add FIXME comment

Created at 3 days ago
push

Move WebSocketTrait to Psr7\Protocol namespace

Add FIXME comment

Created at 3 days ago
delete branch
twose delete branch http
Created at 3 days ago
create branch
twose create branch v0.2.0
Created at 3 days ago
issue comment
fix config arg --with-brotli-dir

下面的代码也需要改才能生效

Created at 4 days ago
create tag
twose create tag v2.0.1
Created at 5 days ago
issue comment
PHP 8 compatibility

Thanks!

Created at 5 days ago
closed issue
PHP 8 compatibility

https://github.com/swoole/grpc/blob/06725261ab2e9f7ab93e332bbe5add31eee48a00/tools/generator#L23

I think the generator should be updated to work with PHP 8.

Created at 5 days ago

Fix deprecated curly brace syntax for string

Closes #32.

Created at 5 days ago

Fix incorrect channel capacity (#31)

Created at 5 days ago
pull request closed
Fix correct channel capacity for openswoole extension

According to Openswoole documentation,

capacity
   Set the channel max capacity, must be greater than or equal to 1.

Ref link - https://openswoole.com/docs/modules/swoole-coroutine-channel-construct

Which causes grpc clients to break between servers.

[2022-01-27 16:40:43] local.ERROR: Swoole\Coroutine\Channel::__construct(): capacity is invalid {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Swoole\\Coroutine\\Channel::__construct(): capacity is invalid at /var/www/vendor/swoole/grpc/src/Grpc/Client.php:207)
[stacktrace]
#0 {main}

This PR can fix above bug.

Created at 5 days ago
pull request closed
Added the body into exception message when the body was parsed failed
Created at 2 weeks ago
started
Created at 3 weeks ago

Update README.md

Created at 1 month ago
push

Naming style: "lowercase" is a word

Add addHeader() and unsetHeader() methods for Message

Remove dead code

We have already did it in dtor function.

Sync deps: libcat

  • libcat/libcat@0a6e02c22f0e104e7060b0dd8ad119e18d2c440a

Fix Coroutine bailout behaviour, add debug logs and tests

Code optimization for with* functions

Created at 1 month ago

Reason should be the last format arg

Created at 1 month ago
push

Prevent stdin read from being affected by global timeout options

Sync deps: libcat

  • libcat/libcat@8ee23a2f30f8d58461dbdb81707224404971e89c

Deadlock test has been fixed

Created at 1 month ago

Sync deps: libuv

  • libcat/libuv@fef4f004b410edc742ab1a9924e27dca8389c6c9

Use round to make sure defer tasks will be triggered in the next round

Add event_print_all_handles() and event_print_active_handles() for debugging

Refactor deadlock logic

Now deadlock warning log will be reported twice, the reason of it is that we set a defer task in the next round to unlock the deadlock, but uv event loop uv_backend_timeout(loop) is 0 for the first loop, so it was unlocked then it continues to the next deadlock. I can not solve this now, and use forever timer to implement deadlock seems unnecessary, so we just use sleep to do that, it can be interrupted by set COROUTINE_G(deadlocked) for debugging.

Created at 1 month ago

Refactor uv_crun() and add options for it

Revert "unix: switch to c11 atomics (#3688)" (FIXME)

This reverts commit ac5180e29cb6db5bfaf2ea2419b50da146fef06e.

Created at 1 month ago
issue comment
z/OS builds broken: `fatal error: 'stdatomic.h' file not found`

I am confused, we have set(CMAKE_C_STANDARD 90) in CMakeLIsts.txt but we are using c11 atomic at the same time... Does this mean we need to switch to the C11 standard now?

Created at 1 month ago

Add options for uv_crun()

Created at 1 month ago
push

Add TODO for observer_enabled

Let php-cs-fixer config be a composer package

Add mask for PONG frame

Improve deadlock test to prevent unexpected extra output

Rename buffer_fetch_string() to buffer_get_string()

fetch() is difference with get(), fetch() is to take away the string.

Return empty string when buffer is closed or unallocated

This should be refactored later, just do defensive programming for now.

Created at 1 month ago
create branch
twose create branch debug
Created at 1 month ago

doc: make sample cross-platform build (#3592)

Co-authored-by: Ben Noordhuis info@bnoordhuis.nl

test: separate some static variables by test cases (#3567)

sunos: fs-event callback can be called after uv_close() (#3542)

On illumos and Solaris, fs events are implemented with PORT_SOURCE_FILE type event ports. These are one-shot so need re-arming each time they fire. Once they are armed and an event occurs, the kernel removes them from the current cache list and puts them on an event queue to be read by the application.

There's a window in closing one of these ports when it could have triggered and be pending delivery. In that case, the attempt to disarm (dissociate) the event will fail with ENOENT but libuv still goes ahead and closes down the handle. In particular, the close callback (uv_close() argument) will be called but then the event will subsequently be delivered if the loop is still active; this should not happen.

uv: re-register interest in a file after change (#3540 1/3)

The file is implicitly unregistered when the change notification is sent, only one notification is sent per registration. So we need to re-register interest in a file after each change notification we receive.

Co-authored-by: Gaby Baghdadi baghdadi@ca.ibm.com

uv: register UV_RENAME event for _RFIM_UNLINK (#3540 2/3)

rename() can be used to rename a file path via _RFIM_UNLINK. So register it as a UV_RENAME event.

Co-authored-by: Igor Todorovski itodorov@ca.ibm.com

uv: register __rfim_event 156 as UV_RENAME (#3540 3/3)

When the watched file is moved or removed, or an editor (e.g. vim) renames then creates the file, the __rfim_event 156 occurs. This is an undocumented event that should not happen, but register it as UV_RENAME for now since it is functionally equivalent.

Co-authored-by: Gaby Baghdadi baghdadi@ca.ibm.com

doc: remove smartos from supported platforms (#3594)

Commit 3af55129 from 2017 distinguished between smartos and other sunos spawn but [0] makes it clear ("a new chapter" - barf) that smartos is dead.

Stop mentioning smartos and put everything under the sunos umbrella.

[0] https://www.joyent.com/blog/a-new-chapter-begins-for-triton-and-smartos

macos: avoid posix_spawnp() cwd bug (#3597)

macOS 10.15 has a bug where configuring the working directory with posix_spawn_file_actions_addchdir_np() makes posix_spawnp() fail with ENOENT even though the executable is spawned successfully.

Co-authored-by: Ben Noordhuis info@bnoordhuis.nl

release: check versions of autogen scripts are newer (#3554)

Use libtoolize --force to ensure it updates m4 directory with the latest files. Add an option "release" to the autogen.sh script that checks the versions of the input tools, so that we know they are always using the latest version for each release.

test: rewrite embed test (#3608)

  • fix busy loop
  • fix multi-thread race conditions
  • reduce amount of platform-specific code

Fixes: https://github.com/libuv/libuv/issues/3606

openbsd: use utimensat instead of lutimes (#3607)

OpenBSD doesn't have lutimes so utimensat should be used instead.

doc: fix link to uvwget example main() function (#3605)

unix: use MSG_CMSG_CLOEXEC where supported (#3609)

Use MSG_CMSG_CLOEXEC on Unix-y platforms that support it (all except macOS and SunOS spawn.)

Remove the feature test for Linux. Libuv's kernel baseline is 2.6.32 and MSG_CMSG_CLOEXEC was added in 2.6.23.

test: remove disabled callback_order test (#3619)

This test has always been disabled for the 10 years of its existence and there are other tests that exercise "what happens when" event ordering.

Fixes: https://github.com/libuv/libuv/issues/3618

win,pipe: fix bugs with pipe resource lifetime management (#3611)

If uv_close was called while a connect was pending, we would fail to release the resources for the connection, since we had not yet set the type of the struct.

Fix a thread data-race on slow connect path code: only permitted to write to req on threads, as anything else causes data race corruption.

There seemed be a small variety of other resource management bugs in edge cases, which turned out to make this a lot larger than initially expected.

Refs: https://github.com/libuv/libuv/pull/3598#issuecomment-1111513567

loop: better align order-of-events behavior between platforms (#3598)

Previously, Windows would always defer event processing to the loop after they were received. This could cause confusion for users who were using prepare and idle callbacks, as seen from this bug in nodejs^1 and this discussion in libuv^2, and even some discrepancies in the libuv tests too[^3].

[^3]: See change to test-spawn.c in this PR

So rather than declare those usages to be wrong, we change libuv to meet those users expectations.

Replaces: https://github.com/libuv/libuv/pull/3585

aix,test: uv_backend_fd is not supported by poll (#3621)

Fixes: https://github.com/libuv/libuv/issues/3614 Co-authored-by: Vasili Skurydzin vasili.skurydzin@ibm.com

kqueue: skip EVFILT_PROC when invalidating fds (#3629)

On NetBSD with libuv 1.44.1 we see that cmake occasionally hangs waiting for a child process to exit, with libuv waiting forever for kevent to deliver more events that never come. The child process has already exited and is waiting to be collected with waitpid.

The hang occurs when the batch of events returned by one call to kevent contains both a EVFILT_READ event for an fd and a later EVFILT_PROC record for the PID with the same value as the earlier fd. What happens is that uv__platform_invalidate_fd is called to invalidate events later in the same batch for the fd, but uv__platform_invalidate_fd invalidates the later EVFILT_PROC event too because it sees the same "ident" value and does not check the "filter" value to differentiate "ident" values that refer to fds vs. "ident" values that refer to PIDs.

Add a check for the "filter" value to avoid confusing these two different kinds of event "ident" values.

darwin: fix atomic-ops.h ppc64 build (#3634)

zos: don't err when killing a zombie process (#3625)

On z/OS, EPERM is returned if the process being killed is a zombie. However, this shouldn't be treated as an error, so return 0 instead.

Co-authored-by: Muntasir Mallick mmallick@ca.ibm.com Co-authored-by: Gaby Baghdadi baghdadi@ca.ibm.com

Created at 1 month ago
started
Created at 1 month ago
started
Created at 1 month ago